Bug 1252479 - Adding the Developer Dynamically (Bug 1248601) doesn't work in SeaMonkey because it doesn't have a "browser-bottombox" r=ochameau

This commit is contained in:
Philip Chee 2016-03-06 01:44:38 +08:00
parent 33219f7083
commit 49bafb02b2

View File

@ -299,7 +299,7 @@ DeveloperToolbar.prototype.createToolbar = function() {
let close = this._doc.createElement("toolbarbutton");
close.setAttribute("id", "developer-toolbar-closebutton");
close.setAttribute("class", "devtools-closebutton");
close.setAttribute("class", "close-icon");
close.setAttribute("oncommand", "DeveloperToolbar.hide();");
close.setAttribute("tooltiptext", "developerToolbarCloseButton.tooltiptext");
@ -333,10 +333,15 @@ DeveloperToolbar.prototype.createToolbar = function() {
toolbar.appendChild(close);
}
let bottomBox = this._doc.getElementById("browser-bottombox");
this._element = toolbar;
bottomBox.appendChild(this._element);
let bottomBox = this._doc.getElementById("browser-bottombox");
if (bottomBox) {
bottomBox.appendChild(this._element);
} else { // SeaMonkey does not have a "browser-bottombox".
let statusBar = this._doc.getElementById("status-bar");
if (statusBar)
statusBar.parentNode.insertBefore(this._element, statusBar);
}
this._errorCounterButton = toolboxBtn
this._errorCounterButton._defaultTooltipText =
this._errorCounterButton.getAttribute("tooltiptext");