- Timestamp:
- 03/11/15 08:18:24 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/src/main/resources/assets/js/search.jsx
r6092 r6093 24 24 var layers = [ 25 25 { 26 id: "text", 27 name: "Text Resources", 28 searchPlaceholder: "Elephant", 29 searchLabel: "Search text", 30 searchLabelBkColor: "#fed", 31 className: '', 32 }, 33 { 26 34 id: "sampa", 27 35 name: "Phonetic Transcriptions", … … 29 37 searchLabel: "SAMPA query", 30 38 searchLabelBkColor: "#eef", 31 }, 32 { 33 id: "text", 34 name: "Text Resources", 35 searchPlaceholder: "Elephant", 36 searchLabel: "Search text", 37 searchLabelBkColor: "#fed", 39 disabled: true, 38 40 }, 39 41 ]; 40 42 var layerMap = { 41 sampa: layers[0],42 text: layers[1],43 text: layers[0], 44 sampa: layers[1], 43 45 }; 44 46 … … 466 468 <ul ref="layerDropdownMenu" className="dropdown-menu"> 467 469 { layers.map(function(l) { 468 return <li key={l.id}> <a tabIndex="-1" href="#" 469 onClick={this.setLayer.bind(this, l.id)}> {l.name} </a></li>; 470 var cls = l.disabled ? 'disabled':''; 471 var handler = function() { if (!l.disabled) this.setLayer(l.id); }; 472 return <li key={l.id} className={cls}> <a tabIndex="-1" href="#" 473 onClick={handler}> {l.name} </a></li>; 470 474 }.bind(this)) 471 475 }
Note: See TracChangeset
for help on using the changeset viewer.