mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Bug 747851 - Only fire change if a select changed. r=mfinkle
This commit is contained in:
1 parent
58f645158e
commit
1668941c17
1 file changed
+6
-1
@@ -28,6 +28,7 @@ var SelectHelper = {
|
||||
if (selected == -1)
|
||||
return;
|
||||
|
||||
var changed = false;
|
||||
if (aElement instanceof Ci.nsIDOMXULMenuListElement) {
|
||||
aElement.selectedIndex = selected;
|
||||
} else if (aElement instanceof HTMLSelectElement) {
|
||||
@@ -40,10 +41,14 @@ var SelectHelper = {
|
||||
}
|
||||
let i = 0;
|
||||
this.forOptions(aElement, function(aNode) {
|
||||
if (aNode.selected != selected[i])
|
||||
changed = true;
|
||||
aNode.selected = selected[i++];
|
||||
});
|
||||
}
|
||||
this.fireOnChange(aElement);
|
||||
|
||||
if (changed)
|
||||
this.fireOnChange(aElement);
|
||||
},
|
||||
|
||||
_isMenu: function(aElement) {
|
||||
|
||||
Reference in new issue
Block a user