Bug 1137238 - Fix toolboxes when switching between apps in WebIDE. r=jryans

This commit is contained in:
Alexandre Poirot 2015-02-26 08:20:00 +01:00
parent ccd2fd16cc
commit dade31edcc

View File

@ -927,8 +927,10 @@ let UI = {
// We can't know for sure which one was used here, so reset the
// |toolboxPromise| since someone must be destroying it to reach here,
// and call our own close method.
this.toolboxPromise = null;
this._closeToolboxUI();
if (this.toolboxIframe && this.toolboxIframe.uid == json.uid) {
this.toolboxPromise = null;
this._closeToolboxUI();
}
break;
}
} catch(e) { console.error(e); }
@ -966,9 +968,13 @@ let UI = {
let iframe = document.createElement("iframe");
iframe.id = "toolbox";
// Compute a uid on the iframe in order to identify toolbox iframe
// when receiving toolbox-close event
iframe.uid = new Date().getTime();
document.querySelector("notificationbox").insertBefore(iframe, splitter.nextSibling);
let host = devtools.Toolbox.HostType.CUSTOM;
let options = { customIframe: iframe, zoom: false };
let options = { customIframe: iframe, zoom: false, uid: iframe.uid };
this.toolboxIframe = iframe;
let height = Services.prefs.getIntPref("devtools.toolbox.footer.height");