mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 747851 - Only fire change if a select changed. r=mfinkle
This commit is contained in:
parent
38c10052c8
commit
1f64028fb8
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user