Skip to content

Commit ab6c744

Browse files
committed
Merge pull request fnagel#145 from Netson/patch-1
Minor optimization
2 parents dfec00b + d35924e commit ab6c744

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

ui/jquery.ui.selectmenu.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,16 @@ $.widget("ui.selectmenu", {
248248
this.element
249249
.find('option')
250250
.each(function() {
251+
var opt = $(this);
251252
selectOptionData.push({
252-
value: $(this).attr('value'),
253+
value: opt.attr('value'),
253254
text: self._formatText($(this).text()),
254-
selected: $(this).attr('selected'),
255-
disabled: $(this).attr('disabled'),
256-
classes: $(this).attr('class'),
257-
typeahead: $(this).attr('typeahead'),
258-
parentOptGroup: $(this).parent('optgroup'),
259-
bgImage: o.bgImage.call($(this))
255+
selected: opt.attr('selected'),
256+
disabled: opt.attr('disabled'),
257+
classes: opt.attr('class'),
258+
typeahead: opt.attr('typeahead'),
259+
parentOptGroup: opt.parent('optgroup'),
260+
bgImage: o.bgImage.call(opt)
260261
});
261262
});
262263

0 commit comments

Comments
 (0)