author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-10-02 07:59:30 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-10-02 07:59:30 (UTC) |
commit | 1180b7b195157aaeb4f0d5380e0c886bbd06c2e2 (patch) (unidiff) | |
tree | 709e33a09d9325d382aabaf0a0828e20ebdb96db /frontend/delta/js/Clipperz/PM/UI/Components/CardList.js | |
parent | 20bea94ab6b91c85b171dcf86baba0a64169d508 (diff) | |
download | clipperz-1180b7b195157aaeb4f0d5380e0c886bbd06c2e2.zip clipperz-1180b7b195157aaeb4f0d5380e0c886bbd06c2e2.tar.gz clipperz-1180b7b195157aaeb4f0d5380e0c886bbd06c2e2.tar.bz2 |
Updated /delta
Switched from less to scss. Still no build script to update the final CSS, though.
Added preliminary support for storing account data on browser's local storage for offline viewing. No public backend currently support this feature.
Diffstat (limited to 'frontend/delta/js/Clipperz/PM/UI/Components/CardList.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/delta/js/Clipperz/PM/UI/Components/CardList.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/frontend/delta/js/Clipperz/PM/UI/Components/CardList.js b/frontend/delta/js/Clipperz/PM/UI/Components/CardList.js index 66d20f1..5a44a4a 100644 --- a/frontend/delta/js/Clipperz/PM/UI/Components/CardList.js +++ b/frontend/delta/js/Clipperz/PM/UI/Components/CardList.js | |||
@@ -88,29 +88,36 @@ console.log("focusOnSearchField", this.refs['searchField']); | |||
88 | React.DOM.input({type:'search', placeholder:"search", ref:'searchField', onChange:this.updateSearchText}) | 88 | React.DOM.input({type:'search', placeholder:"search", ref:'searchField', onChange:this.updateSearchText}) |
89 | ]) | 89 | ]) |
90 | ]); | 90 | ]); |
91 | } else { | 91 | } else { |
92 | result = null; | 92 | result = null; |
93 | } | 93 | } |
94 | 94 | ||
95 | return result; | 95 | return result; |
96 | }, | 96 | }, |
97 | 97 | ||
98 | //========================================================================= | 98 | //========================================================================= |
99 | 99 | ||
100 | showPreferences: function (anEvent) { | ||
101 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'showPreferences', anEvent); | ||
102 | }, | ||
103 | |||
104 | //========================================================================= | ||
105 | |||
100 | cardItem: function (aRecordReference) { | 106 | cardItem: function (aRecordReference) { |
101 | varreference = aRecordReference['_reference']; | 107 | varreference = aRecordReference['_reference']; |
102 | varselectedCard = (reference == this.props.selectedCard); | 108 | varselectedCard = (reference == this.props.selectedCard); |
103 | 109 | ||
104 | returnReact.DOM.div({className:'listItem', onClick:MochiKit.Base.method(this, 'handleClickOnCardDetail', reference)}, [ | 110 | //TODO: verify if it is possible to put the onClick handler on the container 'div', instead of adding it to each 'div' item. |
111 | returnReact.DOM.div({className:'listItem', key:reference, onClick:MochiKit.Base.method(this, 'handleClickOnCardDetail', reference)}, [ | ||
105 | React.DOM.div({className:'labelWrapper'}, React.DOM.span({className:'label'}, aRecordReference.label)), | 112 | React.DOM.div({className:'labelWrapper'}, React.DOM.span({className:'label'}, aRecordReference.label)), |
106 | // React.DOM.div({className:'labelWrapper'}, React.DOM.span({className:'label'}, aRecordReference.label + ' ' + aRecordReference.label + ' ' + aRecordReference.label + ' ' + aRecordReference.label + ' ' + aRecordReference.label)), | 113 | // React.DOM.div({className:'labelWrapper'}, React.DOM.span({className:'label'}, aRecordReference.label + ' ' + aRecordReference.label + ' ' + aRecordReference.label + ' ' + aRecordReference.label + ' ' + aRecordReference.label)), |
107 | React.DOM.div({className:'faviconWrapper'}, aRecordReference.favicon ? React.DOM.img({className:'favicon', src:aRecordReference.favicon}) : React.DOM.div({className:'favicon'}, '\u00A0')), | 114 | React.DOM.div({className:'faviconWrapper'}, aRecordReference.favicon ? React.DOM.img({className:'favicon', src:aRecordReference.favicon}) : React.DOM.div({className:'favicon'}, '\u00A0')), |
108 | React.DOM.div({className:'detailLinkWrapper'}, React.DOM.span({className:'detailLink ' + (selectedCard ? 'icon-spin' : '')}, (selectedCard ? "loading" : "detail"))) | 115 | React.DOM.div({className:'detailLinkWrapper'}, React.DOM.span({className:'detailLink ' + (selectedCard ? 'icon-spin' : '')}, (selectedCard ? "loading" : "detail"))) |
109 | ]); | 116 | ]); |
110 | }, | 117 | }, |
111 | 118 | ||
112 | handleClickOnCardDetail: function (aRecordReference, anEvent) { | 119 | handleClickOnCardDetail: function (aRecordReference, anEvent) { |
113 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'showRecord', aRecordReference); | 120 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'showRecord', aRecordReference); |
114 | }, | 121 | }, |
115 | 122 | ||
116 | cardListItems: function () { | 123 | cardListItems: function () { |
@@ -137,25 +144,25 @@ console.log("focusOnSearchField", this.refs['searchField']); | |||
137 | // | 144 | // |
138 | // newState[refName] = event.target.value; | 145 | // newState[refName] = event.target.value; |
139 | // this.setState(newState); | 146 | // this.setState(newState); |
140 | }, | 147 | }, |
141 | 148 | ||
142 | //========================================================================= | 149 | //========================================================================= |
143 | 150 | ||
144 | render: function() { | 151 | render: function() { |
145 | returnReact.DOM.div(null, [ | 152 | returnReact.DOM.div(null, [ |
146 | React.DOM.div({className:'header'}, [ | 153 | React.DOM.div({className:'header'}, [ |
147 | React.DOM.a({className:'account'}, 'clipperz'), | 154 | React.DOM.a({className:'account'}, 'clipperz'), |
148 | React.DOM.div({className:'features'}, [ | 155 | React.DOM.div({className:'features'}, [ |
149 | React.DOM.a({className:'addCard'}, 'add'), | 156 | // React.DOM.a({className:'addCard'}, 'add'), |
150 | React.DOM.a({className:'search ' + (this.state.showSearch ? 'selected' : ''), onClick:this.toggleSearch}, 'search'), | 157 | React.DOM.a({className:'search ' + (this.state.showSearch ? 'selected' : ''), onClick:this.toggleSearch}, 'search'), |
151 | React.DOM.a({className:'settings'}, 'settings') | 158 | React.DOM.a({className:'settings', onClick:this.showPreferences}, 'settings') |
152 | ]), | 159 | ]), |
153 | // this.searchBox() | 160 | // this.searchBox() |
154 | ]), | 161 | ]), |
155 | this.searchBox(), | 162 | this.searchBox(), |
156 | React.DOM.div({className:'content cardList'}, this.cardListItems()), | 163 | React.DOM.div({className:'content cardList'}, this.cardListItems()), |
157 | ]); | 164 | ]); |
158 | } | 165 | } |
159 | 166 | ||
160 | //========================================================================= | 167 | //========================================================================= |
161 | }); | 168 | }); |