|
34 | 34 | <!-- Wrapper div necessary for sibling CSS selector to work for now -->
|
35 | 35 | <div>
|
36 | 36 | <template id="optionsTemplate" repeat="{{option in options | filter}}">
|
37 |
| - <li class="option {{ { selected: option.selected } | tokenList }}" on-tap="{{onOptionTap}}" highlighted?="{{option === highlighted}}" on-mouseenter="{{onMouseEnter}}">{{option.text}}</li> |
| 37 | + <li class="option {{ { selected: option.selected } | tokenList }}" highlighted?="{{option === highlighted}}" on-mouseenter="{{onMouseEnter}}" on-tap="{{onOptionTap}}">{{option.text}}</li> |
38 | 38 | </template>
|
39 | 39 | <li class="option no-options">No results for "{{filterText}}"</li>
|
40 | 40 | </div>
|
|
114 | 114 | }
|
115 | 115 | },
|
116 | 116 |
|
| 117 | + onMouseEnter: function(event, detail, sender) { |
| 118 | + var model = sender.templateInstance.model.option; |
| 119 | + if (model.selected === false) { |
| 120 | + this.highlighted = model; |
| 121 | + } |
| 122 | + }, |
| 123 | + |
| 124 | + onOptionTap: function(event, detail, sender) { |
| 125 | + var model = sender.templateInstance.model.option; |
| 126 | + if (model.selected === false) { |
| 127 | + this.select(model); |
| 128 | + } |
| 129 | + }, |
| 130 | + |
117 | 131 | ready: function() {
|
118 | 132 | this.selected = [];
|
119 | 133 | },
|
|
128 | 142 | if (this.highlighted && !this.hidden) {
|
129 | 143 | this.select(this.highlighted);
|
130 | 144 | }
|
131 |
| - }, |
132 |
| - |
133 |
| - onMouseEnter: function(event, detail, sender) { |
134 |
| - var model = sender.templateInstance.model.option; |
135 |
| - if (model.selected === false) { |
136 |
| - this.highlighted = model; |
137 |
| - } |
138 |
| - }, |
139 |
| - |
140 |
| - onOptionTap: function(event, detail, sender) { |
141 |
| - var model = sender.templateInstance.model.option; |
142 |
| - if (model.selected === false) { |
143 |
| - this.select(model); |
144 |
| - } |
145 | 145 | }
|
146 | 146 |
|
147 | 147 | });
|
|
0 commit comments