mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-15 20:31:03 +00:00
style(select): fix semicolons and vars
This commit is contained in:
parent
9af8f4e585
commit
fb99f54206
1 changed files with 9 additions and 9 deletions
|
|
@ -148,7 +148,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|||
ngModelCtrl = ngModelCtrl_;
|
||||
nullOption = nullOption_;
|
||||
unknownOption = unknownOption_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.addOption = function(value) {
|
||||
|
|
@ -177,12 +177,12 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|||
$element.prepend(unknownOption);
|
||||
$element.val(unknownVal);
|
||||
unknownOption.prop('selected', true); // needed for IE
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.hasOption = function(value) {
|
||||
return optionsMap.hasOwnProperty(value);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
// disable unknown option so that we don't do work when the whole select is being destroyed
|
||||
|
|
@ -339,7 +339,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|||
var optionGroup,
|
||||
collection = valuesFn(scope) || [],
|
||||
locals = {},
|
||||
key, value, optionElement, index, groupIndex, length, groupLength;
|
||||
key, value, optionElement, index, groupIndex, length, groupLength, trackIndex;
|
||||
|
||||
if (multiple) {
|
||||
value = [];
|
||||
|
|
@ -354,7 +354,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|||
key = optionElement.val();
|
||||
if (keyName) locals[keyName] = key;
|
||||
if (trackFn) {
|
||||
for (var trackIndex = 0; trackIndex < collection.length; trackIndex++) {
|
||||
for (trackIndex = 0; trackIndex < collection.length; trackIndex++) {
|
||||
locals[valueName] = collection[trackIndex];
|
||||
if (trackFn(scope, locals) == key) break;
|
||||
}
|
||||
|
|
@ -373,7 +373,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|||
value = null;
|
||||
} else {
|
||||
if (trackFn) {
|
||||
for (var trackIndex = 0; trackIndex < collection.length; trackIndex++) {
|
||||
for (trackIndex = 0; trackIndex < collection.length; trackIndex++) {
|
||||
locals[valueName] = collection[trackIndex];
|
||||
if (trackFn(scope, locals) == key) {
|
||||
value = valueFn(scope, locals);
|
||||
|
|
@ -446,7 +446,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|||
optionGroupNames.push(optionGroupName);
|
||||
}
|
||||
if (multiple) {
|
||||
selected = selectedSet.remove(trackFn ? trackFn(scope, locals) : valueFn(scope, locals)) != undefined;
|
||||
selected = selectedSet.remove(trackFn ? trackFn(scope, locals) : valueFn(scope, locals)) !== undefined;
|
||||
} else {
|
||||
if (trackFn) {
|
||||
var modelCast = {};
|
||||
|
|
@ -564,7 +564,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}];
|
||||
|
||||
var optionDirective = ['$interpolate', function($interpolate) {
|
||||
|
|
@ -613,5 +613,5 @@ var optionDirective = ['$interpolate', function($interpolate) {
|
|||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
}];
|
||||
|
|
|
|||
Loading…
Reference in a new issue