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

Commit ba547ac

Browse files
committed
Merge branch 'async-resource-fix'
Conflicts: dist/select.css dist/select.css.min.css dist/select.js dist/select.js.min.js
2 parents fe941d8 + 64b6509 commit ba547ac

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

dist/select.css

Lines changed: 1 addition & 1 deletion
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.7.0 - 2014-10-06T10:45:08.128Z
4+
* Version: 0.7.0 - 2014-10-06T11:45:24.369Z
55
* License: MIT
66
*/
77

dist/select.css.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/select.js

Lines changed: 10 additions & 7 deletions
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.7.0 - 2014-10-06T10:45:08.127Z
4+
* Version: 0.7.0 - 2014-10-06T11:45:24.366Z
55
* License: MIT
66
*/
77

@@ -271,6 +271,7 @@
271271
$scope.$watchCollection('$select.selected', function(selectedItems){
272272
if (!selectedItems) return;
273273
var data = ctrl.parserResult.source($scope);
274+
if (!data) return;
274275
var filteredItems = data.filter(function(i) {return selectedItems.indexOf(i) < 0;});
275276
setItemsFn(filteredItems);
276277
});
@@ -376,7 +377,7 @@
376377

377378
ctrl.getPlaceholder = function(){
378379
//Refactor single?
379-
if(ctrl.multiple && ctrl.selected.length) return;
380+
if(ctrl.multiple && (ctrl.selected === undefined || ctrl.selected.length)) return;
380381
return ctrl.placeholder;
381382
};
382383

@@ -591,11 +592,13 @@
591592
result;
592593
if ($select.multiple){
593594
var resultMultiple = [];
594-
for (var j = inputValue.length - 1; j >= 0; j--) {
595-
locals = {};
596-
locals[$select.parserResult.itemName] = inputValue[j];
597-
result = $select.parserResult.modelMapper(scope, locals);
598-
resultMultiple.unshift(result);
595+
if (inputValue) {
596+
for (var j = inputValue.length - 1; j >= 0; j--) {
597+
locals = {};
598+
locals[$select.parserResult.itemName] = inputValue[j];
599+
result = $select.parserResult.modelMapper(scope, locals);
600+
resultMultiple.unshift(result);
601+
}
599602
}
600603
return resultMultiple;
601604
}else{

0 commit comments

Comments
 (0)