Commit 578e6c50 authored by bingchuan's avatar bingchuan

[dev]version 0.19.4_fix 修复选中后插入最后一个

parent 3074ae6b
...@@ -1016,7 +1016,7 @@ ...@@ -1016,7 +1016,7 @@
restrict: 'EA', restrict: 'EA',
templateUrl: function(tElement, tAttrs) { templateUrl: function(tElement, tAttrs) {
var theme = tAttrs.theme || uiSelectConfig.theme; var theme = tAttrs.theme || uiSelectConfig.theme;
return theme + (angular.isDefined(tAttrs.multiple) ? '/select-multiple.tpl.html' : '/select.tpl.html'); return theme + (angular.isDefined(tAttrs.multiple)&&tAttrs.multiple!='false' ? '/select-multiple.tpl.html' : '/select.tpl.html');
}, },
replace: true, replace: true,
transclude: true, transclude: true,
...@@ -1036,7 +1036,7 @@ ...@@ -1036,7 +1036,7 @@
} }
//Multiple or Single depending if multiple attribute presence //Multiple or Single depending if multiple attribute presence
if (angular.isDefined(tAttrs.multiple)) if (angular.isDefined(tAttrs.multiple)&&tAttrs.multiple!='false' )
tElement.append('<ui-select-multiple/>').removeAttr('multiple'); tElement.append('<ui-select-multiple/>').removeAttr('multiple');
else else
tElement.append('<ui-select-single/>'); tElement.append('<ui-select-single/>');
...@@ -1437,7 +1437,7 @@ ...@@ -1437,7 +1437,7 @@
var theme = getAttribute(parent, 'theme') || uiSelectConfig.theme; var theme = getAttribute(parent, 'theme') || uiSelectConfig.theme;
var multi = angular.isDefined(getAttribute(parent, 'multiple')); var multi = angular.isDefined(getAttribute(parent, 'multiple'));
return theme + (multi ? '/match-multiple.tpl.html' : '/match.tpl.html'); return theme + (multi&&parent[0].getAttribute("multiple")!='false' ? '/match-multiple.tpl.html' : '/match.tpl.html');
}, },
link: function(scope, element, attrs, $select) { link: function(scope, element, attrs, $select) {
$select.lockChoiceExpression = attrs.uiLockChoice; $select.lockChoiceExpression = attrs.uiLockChoice;
...@@ -1572,7 +1572,7 @@ ...@@ -1572,7 +1572,7 @@
locals = {}; locals = {};
locals[$select.parserResult.itemName] = $select.selected[j]; locals[$select.parserResult.itemName] = $select.selected[j];
result = $select.parserResult.modelMapper(scope, locals); result = $select.parserResult.modelMapper(scope, locals);
resultMultiple.unshift(result); resultMultiple.push(result);
} }
return resultMultiple; return resultMultiple;
}); });
...@@ -1594,13 +1594,13 @@ ...@@ -1594,13 +1594,13 @@
var matches = /\.([^\s]+)/.exec($select.parserResult.trackByExp); var matches = /\.([^\s]+)/.exec($select.parserResult.trackByExp);
if(propsItemNameMatches && propsItemNameMatches.length > 0 && propsItemNameMatches[1] == $select.parserResult.itemName){ if(propsItemNameMatches && propsItemNameMatches.length > 0 && propsItemNameMatches[1] == $select.parserResult.itemName){
if(matches && matches.length>0 && result[matches[1]] == value[matches[1]]){ if(matches && matches.length>0 && result[matches[1]] == value[matches[1]]){
resultMultiple.unshift(list[p]); resultMultiple.push(list[p]);
return true; return true;
} }
} }
} }
if (angular.equals(result,value)){ if (angular.equals(result,value)){
resultMultiple.unshift(list[p]); resultMultiple.push(list[p]);
return true; return true;
} }
} }
...@@ -1613,7 +1613,7 @@ ...@@ -1613,7 +1613,7 @@
//Check model array of all items available //Check model array of all items available
if (!checkFnMultiple(data, inputValue[k])){ if (!checkFnMultiple(data, inputValue[k])){
//If not found on previous lists, just add it directly to resultMultiple //If not found on previous lists, just add it directly to resultMultiple
resultMultiple.unshift(inputValue[k]); resultMultiple.push(inputValue[k]);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment