Bug 610725 - crash-stats.mozilla.org product selector doesn't work [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2010-12-02 18:52:50 +01:00
Родитель b36b2523a6
Коммит 39833f9ded
2 изменённых файлов: 27 добавлений и 2 удалений

Просмотреть файл

@ -2272,6 +2272,7 @@ var SelectHelperUI = {
get showFilter() {
return this._showFilter;
},
set showFilter(val) {
this._showFilter = val;
if (!this._panel.hidden)
@ -2461,6 +2462,15 @@ var SelectHelperUI = {
clearAll: aClearAll
};
Browser.selectedBrowser.messageManager.sendAsyncMessage("FormAssist:ChoiceSelect", json);
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-select-element
if (!this._list.multiple) {
this._updateControl();
// Update the selectedIndex so the field will fire a new change event if
// needed
this._selectedIndexes = [aIndex];
}
}
};

Просмотреть файл

@ -192,9 +192,24 @@ FormAssistant.prototype = {
}
case "FormAssist:ChoiceChange": {
// ChoiceChange happened once we have move to an other element so we
// should remenber the used wrapper
// ChoiceChange could happened once we have move to an other element or
// to nothing, so we should keep the used wrapper in mind
this._selectWrapper.fireOnChange();
// New elements can be shown when a select is updated so we need to
// reconstruct the inner elements array and to take care of possible
// focus change, this is why we use "self.currentElement" instead of
// using directly "currentElement".
let self = this;
let timer = new Util.Timeout(function() {
let currentElement = self.currentElement;
if (!currentElement)
return;
self._elements = [];
self._currentIndex = self._getAllElements(currentElement);
});
timer.once(0);
break;
}