From edb444640c0c17e2ee4403478aca8e5083dccbf3 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 2 Jan 2011 22:30:48 -0500 Subject: [PATCH] Fix toggling the same. --- common/modules/config.jsm | 2 +- pentadactyl/content/config.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/modules/config.jsm b/common/modules/config.jsm index f7e52dff..d87315eb 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -64,7 +64,7 @@ var ConfigBase = Class("ConfigBase", { + oncommand="toggleSidebar(this.id || this.observes);" xmlns={XUL}/> } util.overlayWindow(window, { append: append.elements() }); diff --git a/pentadactyl/content/config.js b/pentadactyl/content/config.js index 131cebca..bfa17ed4 100644 --- a/pentadactyl/content/config.js +++ b/pentadactyl/content/config.js @@ -213,8 +213,12 @@ var Config = Module("config", ConfigBase, { let menu = document.getElementById("viewSidebarMenu"); for (let [, panel] in Iterator(menu.childNodes)) - if (compare(panel.label, args[0])) - return panel.doCommand(); + if (compare(panel.getAttribute("label"), args[0])) { + let elem = document.getElementById(panel.observes); + if (elem) + elem.doCommand(); + return; + } return dactyl.echoerr("No sidebar " + args[0] + " found"); },