Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 126c9e2

Browse files
committed
fixed #519
1 parent 6b0fd79 commit 126c9e2

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

dist/select.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.11.2 - 2015-03-31T12:42:23.160Z
4+
* Version: 0.11.2 - 2015-04-27T15:06:50.902Z
55
* License: MIT
66
*/
77

dist/select.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.11.2 - 2015-03-31T12:42:23.152Z
4+
* Version: 0.11.2 - 2015-04-27T15:06:50.893Z
55
* License: MIT
66
*/
77

@@ -1035,7 +1035,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
10351035
$select = $scope.$select,
10361036
ngModel;
10371037

1038-
//Wait for link fn to inject it
1038+
//Wait for link fn to inject it
10391039
$scope.$evalAsync(function(){ ngModel = $scope.ngModel; });
10401040

10411041
ctrl.activeMatchIndex = -1;
@@ -1047,7 +1047,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
10471047

10481048
ctrl.refreshComponent = function(){
10491049
//Remove already selected items
1050-
//e.g. When user clicks on a selection, the selected array changes and
1050+
//e.g. When user clicks on a selection, the selected array changes and
10511051
//the dropdown should remove that item
10521052
$select.refreshItems();
10531053
$select.sizeSearchInput();
@@ -1082,7 +1082,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
10821082

10831083
ctrl.getPlaceholder = function(){
10841084
//Refactor single?
1085-
if($select.selected.length) return;
1085+
if (!angular.isUndefined($select.selected) && $select.selected.length) return;
10861086
return $select.placeholder;
10871087
};
10881088

@@ -1146,7 +1146,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
11461146
};
11471147
if (!inputValue) return resultMultiple; //If ngModel was undefined
11481148
for (var k = inputValue.length - 1; k >= 0; k--) {
1149-
//Check model array of currently selected items
1149+
//Check model array of currently selected items
11501150
if (!checkFnMultiple($select.selected, inputValue[k])){
11511151
//Check model array of all items available
11521152
if (!checkFnMultiple(data, inputValue[k])){
@@ -1157,8 +1157,8 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
11571157
}
11581158
return resultMultiple;
11591159
});
1160-
1161-
//Watch for external model changes
1160+
1161+
//Watch for external model changes
11621162
scope.$watchCollection(function(){ return ngModel.$modelValue; }, function(newValue, oldValue) {
11631163
if (oldValue != newValue){
11641164
ngModel.$modelValue = null; //Force scope model value and ngModel value to be out of sync to re-run formatters

dist/select.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/select.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uiSelectMultipleDirective.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
99
$select = $scope.$select,
1010
ngModel;
1111

12-
//Wait for link fn to inject it
12+
//Wait for link fn to inject it
1313
$scope.$evalAsync(function(){ ngModel = $scope.ngModel; });
1414

1515
ctrl.activeMatchIndex = -1;
@@ -21,7 +21,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
2121

2222
ctrl.refreshComponent = function(){
2323
//Remove already selected items
24-
//e.g. When user clicks on a selection, the selected array changes and
24+
//e.g. When user clicks on a selection, the selected array changes and
2525
//the dropdown should remove that item
2626
$select.refreshItems();
2727
$select.sizeSearchInput();
@@ -56,7 +56,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
5656

5757
ctrl.getPlaceholder = function(){
5858
//Refactor single?
59-
if($select.selected.length) return;
59+
if (!angular.isUndefined($select.selected) && $select.selected.length) return;
6060
return $select.placeholder;
6161
};
6262

@@ -120,7 +120,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
120120
};
121121
if (!inputValue) return resultMultiple; //If ngModel was undefined
122122
for (var k = inputValue.length - 1; k >= 0; k--) {
123-
//Check model array of currently selected items
123+
//Check model array of currently selected items
124124
if (!checkFnMultiple($select.selected, inputValue[k])){
125125
//Check model array of all items available
126126
if (!checkFnMultiple(data, inputValue[k])){
@@ -131,8 +131,8 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
131131
}
132132
return resultMultiple;
133133
});
134-
135-
//Watch for external model changes
134+
135+
//Watch for external model changes
136136
scope.$watchCollection(function(){ return ngModel.$modelValue; }, function(newValue, oldValue) {
137137
if (oldValue != newValue){
138138
ngModel.$modelValue = null; //Force scope model value and ngModel value to be out of sync to re-run formatters

0 commit comments

Comments
 (0)