1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-30 19:52:25 +01:00

Fix :tbt Menu Bar. Closes issue #366.

This commit is contained in:
Kris Maglione
2011-02-12 20:07:36 -05:00
parent 61476fca47
commit 261a325ced

View File

@@ -1839,6 +1839,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
var toolbox = document.getElementById("navigator-toolbox");
if (toolbox) {
let hidden = function hidden(elem) (elem.getAttribute("autohide") || elem.getAttribute("collapsed")) == "true";
let toolbarCommand = function (names, desc, action, filter) {
commands.add(names, desc,
function (args) {
@@ -1859,12 +1861,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
toolbarCommand(["toolbars[how]", "tbs[how]"], "Show the named toolbar",
function (toolbar) dactyl.setNodeVisible(toolbar, true),
function (item) item.item.collapsed);
function ({ item }) hidden(item));
toolbarCommand(["toolbarh[ide]", "tbh[ide]"], "Hide the named toolbar",
function (toolbar) dactyl.setNodeVisible(toolbar, false),
function (item) !item.item.collapsed);
function ({ item }) !hidden(item));
toolbarCommand(["toolbart[oggle]", "tbt[oggle]"], "Toggle the named toolbar",
function (toolbar) dactyl.setNodeVisible(toolbar, toolbar.collapsed));
function (toolbar) dactyl.setNodeVisible(toolbar, hidden(toolbar)));
}
commands.add(["time"],