diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-01-13 21:02:21 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-01-13 21:02:21 -0500 |
commit | 3e4fa31139e394de54e2bcba6c54e6dc96dc139f (patch) | |
tree | ec5d7bd8864942d9b0626c8fdc48c3cde2cebc5f /common | |
parent | d62371042cad2b36d80efb45dc88570193e2a6d4 (diff) | |
download | pentadactyl-3e4fa31139e394de54e2bcba6c54e6dc96dc139f.tar.gz |
Fix contents of the Places toolbar when toggled via :tbt or 'go'.
Diffstat (limited to 'common')
-rw-r--r-- | common/content/dactyl.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 79617a61..75e43856 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1063,6 +1063,13 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { get plugins() plugins, + setNodeVisible: function setNodeVisible(node, visible) { + if (window.setToolbarVisibility && node.localName == "toolbar") + window.setToolbarVisibility(node, visible); + else + node.collapsed = !visible; + }, + /** * Quit the host application, no matter how many tabs/windows are open. * @@ -1315,7 +1322,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { ids.map(function (id) document.getElementById(id)) .forEach(function (elem) { if (elem) - elem.collapsed = (opts.indexOf(opt) == -1); + dactyl.setNodeVisible(elem, opts.indexOf(opt) >= 0); }); } } @@ -1915,13 +1922,13 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }; toolbarCommand(["toolbars[how]", "tbs[how]"], "Show the named toolbar", - function (toolbar) toolbar.collapsed = false, + function (toolbar) dactyl.setNodeVisible(toolbar, true), function (item) item.item.collapsed); toolbarCommand(["toolbarh[ide]", "tbh[ide]"], "Hide the named toolbar", - function (toolbar) toolbar.collapsed = true, + function (toolbar) dactyl.setNodeVisible(toolbar, false), function (item) !item.item.collapsed); toolbarCommand(["toolbart[oggle]", "tbt[oggle]"], "Toggle the named toolbar", - function (toolbar) toolbar.collapsed = !toolbar.collapsed); + function (toolbar) dactyl.setNodeVisible(toolbar, toolbar.collapsed)); } commands.add(["time"], |