summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2010-10-03 10:31:28 -0400
committerKris Maglione <maglione.k@gmail.com>2010-10-03 10:31:28 -0400
commitbf715affd4023955de06ac8b78d71a0f9420d409 (patch)
tree66ea5bb66f398530d061bec6229ab610657bf4de /common
parent69ed86178d29ed79189b8af95ee3f979966ca5de (diff)
downloadpentadactyl-bf715affd4023955de06ac8b78d71a0f9420d409.tar.gz
Collapse the tab strip via CSS rather than the collapsed property to deal with the host tending to uncollapse it. Closes issue #37.
--HG-- extra : rebase_source : faa088b37377e1585421a2302f011b32493726ce
Diffstat (limited to 'common')
-rw-r--r--common/content/tabs.js26
1 files changed, 12 insertions, 14 deletions
diff --git a/common/content/tabs.js b/common/content/tabs.js
index ee00c727..7847342b 100644
--- a/common/content/tabs.js
+++ b/common/content/tabs.js
@@ -31,7 +31,10 @@ const Tabs = Module("tabs", {
// hide tabs initially to prevent flickering when 'stal' would hide them
// on startup
if (config.hasTabbrowser)
- config.tabStrip.collapsed = true; // FIXME: see 'stal' comment
+ config.tabStrip.collapsed = true;
+
+ this.tabStyle = styles.addSheet(true, "tab-strip-hiding", config.styleableChrome,
+ "", false, true)
dactyl.commands["tabs.select"] = function (event) {
tabs.select(event.originalTarget.getAttribute("identifier"));
@@ -983,24 +986,19 @@ const Tabs = Module("tabs", {
"number", config.defaults["showtabline"],
{
setter: function (value) {
- // FIXME: we manipulate mTabContainer underneath mStrip so we
- // don't have to fight against the host app's attempts to keep
- // it open - hack! Adding a filter watch to mStrip is probably
- // the cleanest solution.
let tabStrip = config.tabStrip;
- if (value == 0)
- tabStrip.collapsed = true;
+ if (value == 0) {
+ tabs.tabStyle.css = "#" + tabStrip.id + " { visibility: collapse; }"
+ tabs.tabStyle.enabled = true;
+ }
else {
- // FIXME: Why are we preferring our own created preference
- // here? --djk
- let pref = "browser.tabStrip.autoHide";
- if (options.getPref(pref) == null) // Try for FF 3.0 & 3.1
- pref = "browser.tabs.autoHide";
- options.safeSetPref(pref, value == 1, "See 'showtabline' option.");
- tabStrip.collapsed = false;
+ options.safeSetPref("browser.tabs.autoHide", value == 1,
+ "See 'showtabline' option.");
+ tabs.tabStyle.enabled = false;
}
+ tabStrip.collapsed = false;
return value;
},
completer: function (context) [