From 03680bd83061744ba890b0e12c7fc3ba6979367b Mon Sep 17 00:00:00 2001 From: Cevo Date: Fri, 9 Oct 2015 14:19:43 +0200 Subject: [PATCH] information button gets the active buttons and shows i only relevant info (Tim I didn't set the arrays as props because it would require more work and fills the memory and are not going to be reused, gc should delete them) --- .../ascribe_buttons/acl_button_list.js | 2 +- .../ascribe_buttons/acl_information_button.js | 41 ++++++++++--------- js/components/ascribe_detail/edition.js | 17 +++++++- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/js/components/ascribe_buttons/acl_button_list.js b/js/components/ascribe_buttons/acl_button_list.js index ef48dd65..0e49d589 100644 --- a/js/components/ascribe_buttons/acl_button_list.js +++ b/js/components/ascribe_buttons/acl_button_list.js @@ -44,7 +44,7 @@ let AclButtonList = React.createClass({ render() { return ( -
+
{title} @@ -71,30 +73,33 @@ let AclInformationButton = React.createClass({ {example}

); }; + this.rows = enabledIndices.map((i)=>{ + return (createJSXTextSnippet(getLangText(titleList[i]), getLangText(infoSentenceList[i]), + getLangText(exampleSentenceList[i]), + titleStyle, infoStyle, exampleStyle)); + }); + + /** for (let i = 0; i < titleList.length; i++){ rows.push(createJSXTextSnippet(getLangText(titleList[i]), getLangText(infoSentenceList[i]), getLangText(exampleSentenceList[i]), titleStyle, infoStyle, exampleStyle)); } - return { - rows: rows, - dropdownButtonStyle: { + */ + + this.dropdownButtonStyle = { background: 'none', color: 'black', padding: 0, border: 'none' - }, - dropdownListStyle: { + }; + this.dropdownListStyle = { textAlign: 'justify', width: '80.8%', border: '1px solid #CCC', backgroundColor: 'white', padding: '0.5em' - } - }; - }, - getInitialState() { - return {isVisible: false}; + }; }, onOff() { if (!this.state.isVisible) { @@ -106,17 +111,15 @@ let AclInformationButton = React.createClass({ }, showInformation() { if (this.state.isVisible) { - return this.props.rows; + return this.rows; } }, render() { return ( -