1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 17:55:46 +01:00

Remove some redundant version-specific code.

This commit is contained in:
Doug Kearns
2014-02-08 00:05:35 +11:00
parent c8b430cd8f
commit 789b44209c
8 changed files with 54 additions and 115 deletions

View File

@@ -263,16 +263,6 @@ var CommandWidgets = Class("CommandWidgets", {
}
[this.commandbar.container, this.statusbar.container].forEach(check);
// Work around a redrawing bug.
if (changed && config.haveGecko("16", "20")) {
util.delay(function () {
// Urgh.
statusline.statusBar.style.paddingRight = "1px";
DOM(statusline.statusBar).rect; // Force reflow.
statusline.statusBar.style.paddingRight = "";
}, 0);
}
if (this.initialized && loaded.mow && mow.visible)
mow.resize(false);
},

View File

@@ -1367,10 +1367,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
styles.system.add("taboptions", "chrome://*",
classes.length ? classes.join(",") + "{ display: none; }" : "");
if (!dactyl.has("Gecko2")) {
tabs.tabBinding.enabled = Array.some(opts, k => k in this.opts);
tabs.updateTabCount();
}
if (config.tabbrowser.tabContainer._positionPinnedTabs)
config.tabbrowser.tabContainer._positionPinnedTabs();
},

View File

@@ -73,28 +73,26 @@ var Tabs = Module("tabs", {
updateTabCount: function updateTabCount() {
for (let [i, tab] in Iterator(this.visibleTabs)) {
if (dactyl.has("Gecko2")) {
let node = function node(class_) document.getAnonymousElementByAttribute(tab, "class", class_);
if (!node("dactyl-tab-number")) {
let img = node("tab-icon-image");
if (img) {
let dom = DOM([
["xul:hbox", { highlight: "tab-number" },
["xul:label", { key: "icon", align: "center", highlight: "TabIconNumber",
class: "dactyl-tab-icon-number" }]],
["xul:hbox", { highlight: "tab-number" },
["html:div", { key: "label", highlight: "TabNumber",
class: "dactyl-tab-number" }]]],
document).appendTo(img.parentNode);
let node = function node(class_) document.getAnonymousElementByAttribute(tab, "class", class_);
if (!node("dactyl-tab-number")) {
let img = node("tab-icon-image");
if (img) {
let dom = DOM([
["xul:hbox", { highlight: "tab-number" },
["xul:label", { key: "icon", align: "center", highlight: "TabIconNumber",
class: "dactyl-tab-icon-number" }]],
["xul:hbox", { highlight: "tab-number" },
["html:div", { key: "label", highlight: "TabNumber",
class: "dactyl-tab-number" }]]],
document).appendTo(img.parentNode);
update(tab, {
get dactylOrdinal() Number(dom.nodes.icon.value),
set dactylOrdinal(i) {
dom.nodes.icon.value = dom.nodes.label.textContent = i;
this.setAttribute("dactylOrdinal", i);
}
});
}
update(tab, {
get dactylOrdinal() Number(dom.nodes.icon.value),
set dactylOrdinal(i) {
dom.nodes.icon.value = dom.nodes.label.textContent = i;
this.setAttribute("dactylOrdinal", i);
}
});
}
}
tab.dactylOrdinal = i + 1;
@@ -1224,7 +1222,7 @@ var Tabs = Module("tabs", {
tabs.tabStyle.enabled = false;
}
if (value !== "multitab" || !dactyl.has("Gecko2"))
if (value !== "multitab")
if (tabs.xulTabs)
tabs.xulTabs.visible = value !== "never";
else