1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 10:08:00 +01:00

Only apply tab binding if tab numbers are enabled.

This commit is contained in:
Kris Maglione
2009-04-07 15:45:26 -04:00
parent efed0636d1
commit 31ca8391b9
3 changed files with 18 additions and 9 deletions

View File

@@ -136,9 +136,11 @@ const liberator = (function () //{{{
}, },
setter: function (opts) setter: function (opts)
{ {
const self = this;
let classes = [v[1] for ([k, v] in Iterator(this.opts)) if (opts.indexOf(k) < 0)]; let classes = [v[1] for ([k, v] in Iterator(this.opts)) if (opts.indexOf(k) < 0)];
let css = classes.length ? classes.join(",") + "{ display: none; }" : ""; let css = classes.length ? classes.join(",") + "{ display: none; }" : "";
styles.addSheet(true, "taboptions", "chrome://*", css); styles.addSheet(true, "taboptions", "chrome://*", css);
tabs.tabsBound = Array.some(opts, function(k) k in self.opts);
statusline.updateTabCount(); statusline.updateTabCount();
} }
} }

View File

@@ -76,9 +76,9 @@ Highlights.prototype.CSS = <![CDATA[
StatusLineSecure color: black; background: #a0a0FF /* light-blue */ StatusLineSecure color: black; background: #a0a0FF /* light-blue */
StatusLineExtended color: black; background: #a0FFa0 /* light-green */ StatusLineExtended color: black; background: #a0FFa0 /* light-green */
TabClose TabClose,.tab-close-button
TabIcon TabIcon,.tab-icon
TabText TabText,.tab-text
TabNumber font-weight: bold; margin: 0px; padding-right: .3ex; TabNumber font-weight: bold; margin: 0px; padding-right: .3ex;
TabIconNumber { TabIconNumber {
font-weight: bold; font-weight: bold;
@@ -332,7 +332,7 @@ function Styles(name, store, serial)
{ {
let sheets = system ? systemSheets : userSheets; let sheets = system ? systemSheets : userSheets;
let names = system ? systemNames : userNames; let names = system ? systemNames : userNames;
if (typeof sheet == "number") if (typeof sheet === "number")
return sheets[sheet]; return sheets[sheet];
return names[sheet] return names[sheet]
}; };

View File

@@ -204,11 +204,6 @@ function Tabs() //{{{
], ],
validator: Option.validateCompleter validator: Option.validateCompleter
}); });
let fragment = liberator.has("MacUnix") ? "tab-mac" : "tab";
// TODO: Add option, or only apply when go~=[nN]
styles.addSheet(true, "tab-binding", "chrome://browser/content/browser.xul",
".tabbrowser-tab { -moz-binding: url(chrome://liberator/content/bindings.xml#" + fragment + ") !important; }");
} }
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
@@ -663,6 +658,18 @@ function Tabs() //{{{
yield [i, browsers[i]]; yield [i, browsers[i]];
}, },
get tabsBound() {
return Boolean(styles.get(true, "tab-binding"))
},
set tabsBound(val) {
let fragment = liberator.has("MacUnix") ? "tab-mac" : "tab";
if (!val)
styles.removeSheet(true, "tab-binding");
else if (!this.tabsBound)
styles.addSheet(true, "tab-binding", "chrome://browser/content/browser.xul",
".tabbrowser-tab { -moz-binding: url(chrome://liberator/content/bindings.xml#" + fragment + ") !important; }");
},
get count() getBrowser().mTabs.length, get count() getBrowser().mTabs.length,
get options() get options()