-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathui-multiselect.html
45 lines (39 loc) · 1.42 KB
/
ui-multiselect.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<div ng-style="{'width': width + 'px'}"
class="ng-ms"
ng-class="{'ng-ms-hover': hoverInput, 'ng-ms-focus': focusInput}"
ng-mouseover="hoverInput = true" ng-mouseleave="hoverInput = false">
<ul>
<li ng-repeat="item in output track by $index">
<span class="chosen"
ng-class="focusChoice[$index] ? 'chosen-focused' : ''"
ng-click="removeItem($index)">
{{item}} <span class="remove">X</span>
</span>
</li>
<li>
<input ng-model="query"
placeholder="{{placeholder}}"
ng-style="{'width': inputWidth + 'px'}"
ui-event="{focus: 'focus()', blur: 'blur()'}"
ng-keydown="keyParser($event)"/>
</li>
</ul>
</div> <!--input-->
<div class="ng-ms-selector"
ng-style="{'width': width + 'px'}"
ng-show="showSelector"
ng-mouseenter="hoverSelector = true" ng-mouseleave="hoverSelector = false">
<ul>
<li ng-repeat="item in (filteredData = (data | filter: query | limitTo: limitFilter))"
ng-class="$parent.selectorPosition === $index ? 'choice-selected' : ''"
ng-animate="'selector'">
<div class="choice"
ng-click="addItem(item, output.length, $event)"
ng-mouseenter="$parent.selectorPosition = $index">
<span ng-bind-html-unsafe="'{{item}}' | underline: query"></span>
</div>
</li>
</ul> <!--data-->
<div class="selector-more" ng-show="filteredData.length >= limitFilter">
•••</div>
</div> <!--selector-->