Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c17c731

Browse files
committed
style(select): cleaning up select.js
1 parent 3692885 commit c17c731

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/widget/select.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ angularWidget('select', function(element){
237237
// This is an array of array of existing option groups in DOM. We try to reuse these if possible
238238
// optionGroupsCache[0] is the options with no option group
239239
// optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element
240-
optionGroupsCache = [[{element: selectElement, label:''}]],
241-
inChangeEvent;
240+
optionGroupsCache = [[{element: selectElement, label:''}]];
242241

243242
// find existing special options
244243
forEach(selectElement.children(), function(option) {
@@ -358,12 +357,12 @@ angularWidget('select', function(element){
358357

359358
if (optionGroupsCache.length <= groupIndex) {
360359
// we need to grow the optionGroups
361-
optionGroupsCache.push(
362-
existingOptions = [existingParent = {
363-
element: optGroupTemplate.clone().attr('label', optionGroupName),
364-
label: optionGroup.label
365-
}]
366-
);
360+
existingParent = {
361+
element: optGroupTemplate.clone().attr('label', optionGroupName),
362+
label: optionGroup.label
363+
};
364+
existingOptions = [existingParent];
365+
optionGroupsCache.push(existingOptions);
367366
selectElement.append(existingParent.element);
368367
} else {
369368
existingOptions = optionGroupsCache[groupIndex];

0 commit comments

Comments
 (0)