|
30 | 30 | // scope.users = []; // shaded, prototypical inheritance
|
31 | 31 | var $select = ctrls[0];
|
32 | 32 | var ngModel = ctrls[1];
|
| 33 | + |
33 | 34 | var searchInput = element.querySelectorAll('input.ui-select-search');
|
34 | 35 |
|
35 | 36 | //From view --> model
|
|
79 | 80 | $select.selected = ngModel.$viewValue;
|
80 | 81 | };
|
81 | 82 |
|
| 83 | + |
| 84 | + element.on('focus', function(){ |
| 85 | + console.log('focus event on dropdown-list') |
| 86 | + }); |
82 | 87 |
|
83 | 88 | // handle key press
|
84 | 89 | element.on('keydown', function(e) {
|
85 | 90 | var key = e.which;
|
| 91 | + console.log('key event on dropdown-list'); |
86 | 92 | scope.$apply(function() {
|
87 | 93 | var processed = false;
|
88 | 94 | if (!processed && $select.items.length > 0) {
|
|
173 | 179 | // var transcludedElement = clone.filter('.my-class')
|
174 | 180 | // instead of creating a hackish DOM element:
|
175 | 181 | // debugger;
|
176 |
| - element.append(clone); |
177 |
| - // debugger; |
178 |
| - // var transcludedMatch = transcluded.querySelectorAll('.ui-select-match'); |
| 182 | + // element.append(clone); |
| 183 | + var transcluded = angular.element('<div>').append(clone); |
| 184 | + var transcludedMatch = transcluded.querySelectorAll('.acq-dropdown-selected'); |
| 185 | + |
179 | 186 | // transcludedMatch.removeAttr('ui-select-match'); //To avoid loop in case directive as attr
|
180 |
| - // //if (transcludedMatch.length !== 1) { |
181 |
| - // // throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-match but got '{0}'.", transcludedMatch.length); |
182 |
| - // //} |
183 |
| - // element.querySelectorAll('.ui-select-match').replaceWith(transcludedMatch); |
| 187 | + //if (transcludedMatch.length !== 1) { |
| 188 | + // throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-match but got '{0}'.", transcludedMatch.length); |
| 189 | + //} |
| 190 | + element.querySelectorAll('.acq-dropdown-selected').replaceWith(transcludedMatch); |
184 | 191 |
|
185 |
| - // var transcludedChoices = transcluded.querySelectorAll('.ui-select-choices'); |
| 192 | + var transcludedChoices = transcluded.querySelectorAll('.acq-dropdown-item'); |
186 | 193 | // transcludedChoices.removeAttr('ui-select-choices'); //To avoid loop in case directive as attr
|
187 |
| - // //if (transcludedChoices.length !== 1) { |
188 |
| - // // throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-choices but got '{0}'.", transcludedChoices.length); |
189 |
| - // //} |
190 |
| - // element.querySelectorAll('.ui-select-choices').replaceWith(transcludedChoices); |
| 194 | + //if (transcludedChoices.length !== 1) { |
| 195 | + // throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-choices but got '{0}'.", transcludedChoices.length); |
| 196 | + //} |
| 197 | + element.querySelectorAll('.acq-dropdown-item').replaceWith(transcludedChoices); |
191 | 198 | });
|
192 | 199 | // debugger;
|
193 | 200 |
|
|
0 commit comments