Bug 747851 - Only fire change if a select changed. r=mfinkle

This commit is contained in:
Wes Johnston 2012-05-30 13:23:13 -07:00
parent 38c10052c8
commit 1f64028fb8

View File

@ -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) {