Bug 614540 - Form Helper should not close when data are load in the background [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2010-12-09 10:58:01 -05:00
Родитель 3bcc2717c1
Коммит 3f48472856
3 изменённых файлов: 13 добавлений и 7 удалений

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

@ -1737,7 +1737,7 @@ var FindHelperUI = {
},
handleEvent: function findHelperHandleEvent(aEvent) {
if (aEvent.type == "TabSelect" || aEvent.type == "URLChanged")
if (aEvent.type == "TabSelect" || (aEvent.type == "URLChanged" && aEvent.target == Browser.selectedBrowser))
this.hide();
},
@ -1918,10 +1918,14 @@ var FormHelperUI = {
switch (aEvent.type) {
case "TabSelect":
case "TabClose":
case "URLChanged":
this.hide();
break;
case "URLChanged":
if (aEvent.target == Browser.selectedBrowser)
this.hide();
break;
case "resize":
setTimeout(function(self) {
SelectHelperUI.resize();

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

@ -1870,7 +1870,7 @@ IdentityHandler.prototype = {
},
handleEvent: function(aEvent) {
if (aEvent.type == "URLChanged" && !this._identityPopup.hidden)
if (aEvent.type == "URLChanged" && aEvent.target == Browser.selectedBrowser && !this._identityPopup.hidden)
this.hide();
}
};
@ -2347,6 +2347,10 @@ ProgressController.prototype = {
Browser.scrollContentToTop({ x: 0 });
}
}
let event = document.createEvent("Events");
event.initEvent("URLChanged", true, false);
this.browser.dispatchEvent(event);
},
/**
@ -2391,10 +2395,6 @@ ProgressController.prototype = {
if (this._tab.browser.currentURI.spec == "about:blank")
BrowserUI.updateURI();
}
let event = document.createEvent("Events");
event.initEvent("URLChanged", true, false);
this.browser.dispatchEvent(event);
},
_networkStop: function _networkStop() {

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

@ -91,7 +91,9 @@ FormAssistant.prototype = {
set currentIndex(aIndex) {
let element = this._elements[aIndex];
if (element) {
this.focusSync = false;
gFocusManager.setFocus(element, Ci.nsIFocusManager.FLAG_NOSCROLL);
this.focusSync = true;
this._currentIndex = aIndex;
sendAsyncMessage("FormAssist:Show", this._getJSON());
}