Bug 639530 - Suggestions bubble persists on results page after filling out the search form [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2011-05-09 13:28:48 +02:00
Родитель 97001fe39e
Коммит 270b7c6ac5
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -79,6 +79,7 @@ function FormAssistant() {
addEventListener("focus", this, true); addEventListener("focus", this, true);
addEventListener("pageshow", this, false); addEventListener("pageshow", this, false);
addEventListener("pagehide", this, false); addEventListener("pagehide", this, false);
addEventListener("submit", this, false);
this._enabled = Services.prefs.getBoolPref("formhelper.enabled"); this._enabled = Services.prefs.getBoolPref("formhelper.enabled");
}; };
@ -295,6 +296,11 @@ FormAssistant.prototype = {
let currentElement = this.currentElement; let currentElement = this.currentElement;
switch (aEvent.type) { switch (aEvent.type) {
case "submit":
// submit is a final action and the form assistant should be closed
this.close();
break;
case "pagehide": case "pagehide":
case "pageshow": case "pageshow":
// When reacting to a page show/hide, if the focus is different this // When reacting to a page show/hide, if the focus is different this