From d6fc8c5cb5b7161e84bef62c4bb6a8e2ce8c7e8c Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 17 Dec 2010 02:43:41 -0500 Subject: Fix tab numbers again. --HG-- extra : rebase_source : 8461c5bed454c0522fcad7a71163a4de338f55f7 --- common/content/configbase.js | 9 +++------ common/content/tabs.js | 12 ++++++++---- common/skin/dactyl.css | 6 ++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/common/content/configbase.js b/common/content/configbase.js index 99bdb1ef..81f8f0d0 100644 --- a/common/content/configbase.js +++ b/common/content/configbase.js @@ -232,20 +232,17 @@ const ConfigBase = Class(ModuleBase, { StatusLineExtended color: black !important; background: #a0FFa0 !important /* light-green */ TabClose;.tab-close-button - TabIcon;.tab-icon + TabIcon;.tab-icon min-width: 16px; TabText;.tab-text - TabNumber font-weight: bold; margin: 0px; padding-right: .3ex; - TabNumber::after content: counter(dactyl-tab-number); + TabNumber font-weight: bold; margin: 0px; padding-right: .8ex; TabIconNumber { width: 16px; - margin-left: -16px; - display: block; + margin: 0 2px 0 -18px !important; font-weight: bold; color: white; text-align: center; text-shadow: black -1px 0 1px, black 0 1px 1px, black 1px 0 1px, black 0 -1px 1px; } - TabIconNumber::after content: counter(dactyl-tab-number); Title color: magenta; background: white; font-weight: bold; URL text-decoration: none; color: green; background: inherit; diff --git a/common/content/tabs.js b/common/content/tabs.js index 29b0be24..212e5a19 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -37,16 +37,20 @@ const Tabs = Module("tabs", { }, _updateTabCount: function () { - for (let tab in values(this.allTabs)) { + for (let [i, tab] in Iterator(this.visibleTabs)) { function node(clas) document.getAnonymousElementByAttribute(tab, "class", clas); if (!node("dactyl-tab-number")) { + let nodes = {}; let dom = util.xmlToDom(.*, document); + >.*, document, nodes); let img = node("tab-icon-image"); img.parentNode.appendChild(dom); + tab.__defineGetter__("ordinal", function () Number(nodes.icon.value)); + tab.__defineSetter__("ordinal", function (i) nodes.icon.value = nodes.label.textContent = i); } + tab.ordinal = i + 1; } statusline.updateTabCount(true); }, diff --git a/common/skin/dactyl.css b/common/skin/dactyl.css index 93744980..ea5d71e8 100644 --- a/common/skin/dactyl.css +++ b/common/skin/dactyl.css @@ -80,10 +80,8 @@ @-moz-document url-prefix(chrome://) { -xul|tabs, xul|tabbrowser { counter-reset: dactyl-tab-number; } -xul|tab { counter-increment: dacytl-tab-number; } -.tab-icon-image, .tab-throbber { -moz-box-ordinal-group: 10; } -[dactyl|highlight~=TabNumber], [dactyl|highlight~=TabIconNumber] { -moz-box-ordinal-group: 20; } +.tab-icon-image, .tab-throbber { -moz-box-ordinal-group: 10; } +[dactyl|highlight~=tab-number] { -moz-box-ordinal-group: 20; } .tab-text, .tab-label, .tab-close-button { -moz-box-ordinal-group: 50; } #addon-bar > #addonbar-closebutton { -- cgit v1.2.3