|
1 | 1 | /*! |
2 | 2 | * ui-select |
3 | 3 | * http://github.com/angular-ui/ui-select |
4 | | - * Version: 0.8.0 - 2014-10-06T23:55:23.047Z |
| 4 | + * Version: 0.8.1 - 2014-10-07T21:36:20.165Z |
5 | 5 | * License: MIT |
6 | 6 | */ |
7 | 7 |
|
|
269 | 269 | if (ctrl.multiple){ |
270 | 270 | //Remove already selected items |
271 | 271 | $scope.$watchCollection('$select.selected', function(selectedItems){ |
272 | | - if (!selectedItems.length) return; |
273 | 272 | var data = ctrl.parserResult.source($scope); |
274 | | - var filteredItems = data.filter(function(i) {return selectedItems.indexOf(i) < 0;}); |
275 | | - setItemsFn(filteredItems); |
| 273 | + if (!selectedItems.length) { |
| 274 | + setItemsFn(data); |
| 275 | + }else{ |
| 276 | + var filteredItems = data.filter(function(i) {return selectedItems.indexOf(i) < 0;}); |
| 277 | + setItemsFn(filteredItems); |
| 278 | + } |
276 | 279 | ctrl.sizeSearchInput(); |
277 | 280 | }); |
278 | 281 | } |
|
933 | 936 | }()); |
934 | 937 |
|
935 | 938 | angular.module("ui.select").run(["$templateCache", function($templateCache) {$templateCache.put("bootstrap/choices.tpl.html","<ul class=\"ui-select-choices ui-select-choices-content dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\" ng-show=\"$select.items.length > 0\"><li class=\"ui-select-choices-group\"><div class=\"divider\" ng-show=\"$select.isGrouped && $index > 0\"></div><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label dropdown-header\">{{$group.name}}</div><div class=\"ui-select-choices-row\" ng-class=\"{active: $select.isActive(this), disabled: $select.isDisabled(this)}\"><a href=\"javascript:void(0)\" class=\"ui-select-choices-row-inner\"></a></div></li></ul>"); |
936 | | -$templateCache.put("bootstrap/match-multiple.tpl.html","<span class=\"ui-select-match\"><span ng-repeat=\"$item in $select.selected\"><button style=\"margin-right: 3px;\" class=\"ui-select-match-item btn btn-default btn-xs\" tabindex=\"-1\" type=\"button\" ng-disabled=\"$select.disabled\" ng-click=\"$select.activeMatchIndex = $index;\" ng-class=\"{\'btn-primary\':$select.activeMatchIndex === $index}\"><span class=\"close ui-select-match-close\" ng-hide=\"$select.disabled\" ng-click=\"$select.removeChoice($index)\"> ×</span> <span uis-transclude-append=\"\"></span></button></span></span>"); |
| 939 | +$templateCache.put("bootstrap/match-multiple.tpl.html","<span class=\"ui-select-match\"><span ng-repeat=\"$item in $select.selected\"><span style=\"margin-right: 3px;\" class=\"ui-select-match-item btn btn-default btn-xs\" tabindex=\"-1\" type=\"button\" ng-disabled=\"$select.disabled\" ng-click=\"$select.activeMatchIndex = $index;\" ng-class=\"{\'btn-primary\':$select.activeMatchIndex === $index}\"><span class=\"close ui-select-match-close\" ng-hide=\"$select.disabled\" ng-click=\"$select.removeChoice($index)\"> ×</span> <span uis-transclude-append=\"\"></span></span></span></span>"); |
937 | 940 | $templateCache.put("bootstrap/match.tpl.html","<button type=\"button\" class=\"btn btn-default form-control ui-select-match\" tabindex=\"-1\" ng-hide=\"$select.open\" ng-disabled=\"$select.disabled\" ng-class=\"{\'btn-default-focus\':$select.focus}\" ;=\"\" ng-click=\"$select.activate()\"><span ng-show=\"$select.searchEnabled && $select.isEmpty()\" class=\"text-muted\">{{$select.placeholder}}</span> <span ng-hide=\"$select.isEmpty()\" ng-transclude=\"\"></span> <span class=\"caret ui-select-toggle\" ng-click=\"$select.toggle($event)\"></span></button>"); |
938 | 941 | $templateCache.put("bootstrap/select-multiple.tpl.html","<div class=\"ui-select-multiple ui-select-bootstrap dropdown form-control\" ng-class=\"{open: $select.open}\"><div><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"ui-select-search input-xs\" placeholder=\"{{$select.getPlaceholder()}}\" ng-disabled=\"$select.disabled\" ng-hide=\"$select.disabled\" ng-click=\"$select.activate()\" ng-model=\"$select.search\"></div><div class=\"ui-select-choices\"></div></div>"); |
939 | 942 | $templateCache.put("bootstrap/select.tpl.html","<div class=\"ui-select-bootstrap dropdown\" ng-class=\"{open: $select.open}\"><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"off\" tabindex=\"-1\" class=\"form-control ui-select-search\" placeholder=\"{{$select.placeholder}}\" ng-model=\"$select.search\" ng-show=\"$select.searchEnabled && $select.open\"><div class=\"ui-select-choices\"></div></div>"); |
|
0 commit comments