From 7a023373bf96469eb7c16946e685031dfe281366 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 13 Jan 2011 23:55:51 -0500 Subject: [PATCH] Fix some issues with magically toolbarless popups. Update issue 148 This fixes some particular issues with these types of popups, but I no longer see the original problem (though window.content is certainly still null). --- common/content/commandline.js | 2 +- common/content/tabs.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/common/content/commandline.js b/common/content/commandline.js index 42aee812..6dde07db 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -143,7 +143,7 @@ var CommandWidgets = Class("CommandWidgets", { return this.statusbar; let statusElem = this.statusbar.message; - if (value && statusElem.editor.rootElement.scrollWidth > statusElem.scrollWidth) + if (value && statusElem.editor && statusElem.editor.rootElement.scrollWidth > statusElem.scrollWidth) return this.commandbar; return this.activeGroup.mode; } diff --git a/common/content/tabs.js b/common/content/tabs.js index af69e406..c34ad6cb 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -55,15 +55,17 @@ var Tabs = Module("tabs", { if (dactyl.has("Gecko2")) { let node = function node(clas) document.getAnonymousElementByAttribute(tab, "class", clas); if (!node("dactyl-tab-number")) { - let nodes = {}; - let dom = util.xmlToDom(.*, document, nodes); let img = node("tab-icon-image"); - img.parentNode.appendChild(dom); - tab.__defineGetter__("dactylOrdinal", function () Number(nodes.icon.value)); - tab.__defineSetter__("dactylOrdinal", function (i) nodes.icon.value = nodes.label.textContent = i); + if (img) { + let nodes = {}; + let dom = util.xmlToDom(.*, document, nodes); + img.parentNode.appendChild(dom); + tab.__defineGetter__("dactylOrdinal", function () Number(nodes.icon.value)); + tab.__defineSetter__("dactylOrdinal", function (i) nodes.icon.value = nodes.label.textContent = i); + } } } tab.setAttribute("dactylOrdinal", i + 1);