mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-24 01:55:46 +01:00
Fix :tbt Menu Bar. Closes issue #366.
This commit is contained in:
@@ -1839,6 +1839,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
|
|
||||||
var toolbox = document.getElementById("navigator-toolbox");
|
var toolbox = document.getElementById("navigator-toolbox");
|
||||||
if (toolbox) {
|
if (toolbox) {
|
||||||
|
let hidden = function hidden(elem) (elem.getAttribute("autohide") || elem.getAttribute("collapsed")) == "true";
|
||||||
|
|
||||||
let toolbarCommand = function (names, desc, action, filter) {
|
let toolbarCommand = function (names, desc, action, filter) {
|
||||||
commands.add(names, desc,
|
commands.add(names, desc,
|
||||||
function (args) {
|
function (args) {
|
||||||
@@ -1859,12 +1861,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
|
|
||||||
toolbarCommand(["toolbars[how]", "tbs[how]"], "Show the named toolbar",
|
toolbarCommand(["toolbars[how]", "tbs[how]"], "Show the named toolbar",
|
||||||
function (toolbar) dactyl.setNodeVisible(toolbar, true),
|
function (toolbar) dactyl.setNodeVisible(toolbar, true),
|
||||||
function (item) item.item.collapsed);
|
function ({ item }) hidden(item));
|
||||||
toolbarCommand(["toolbarh[ide]", "tbh[ide]"], "Hide the named toolbar",
|
toolbarCommand(["toolbarh[ide]", "tbh[ide]"], "Hide the named toolbar",
|
||||||
function (toolbar) dactyl.setNodeVisible(toolbar, false),
|
function (toolbar) dactyl.setNodeVisible(toolbar, false),
|
||||||
function (item) !item.item.collapsed);
|
function ({ item }) !hidden(item));
|
||||||
toolbarCommand(["toolbart[oggle]", "tbt[oggle]"], "Toggle the named toolbar",
|
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"],
|
commands.add(["time"],
|
||||||
|
|||||||
Reference in New Issue
Block a user