mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-19 23:07:58 +01:00
Fix tab numbers again.
--HG-- extra : rebase_source : 8461c5bed454c0522fcad7a71163a4de338f55f7
This commit is contained in:
@@ -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(<xul xmlns:xul={XUL} xmlns:html={XHTML}
|
||||
><xul:hbox highlight="TabIconNumber" class="dactyl-tab-number"
|
||||
/><xul:hbox highlight="TabNumber"
|
||||
/></xul>.*, document);
|
||||
><xul:hbox highlight="tab-number"><xul:label key="icon" align="center" highlight="TabIconNumber" class="dactyl-tab-number"/></xul:hbox
|
||||
><xul:hbox highlight="tab-number"><html:div key="label" highlight="TabNumber"/></xul:hbox
|
||||
></xul>.*, 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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user