Skip to content

Commit 6850223

Browse files
committed
Tab clicking tabs cleanup
1 parent 0e3bd5d commit 6850223

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

chrome/content/preferences.xul

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,13 @@
349349

350350
<tabbox>
351351
<tabs id="tabClickingTabs" onselect="onTabClickingTabSelect();">
352-
<tab label="&pane3.tab1.title;"/>
353-
<tab label="&pane3.tab2.title;"/>
354-
<tab label="&pane3.tab3.title;"/>
355-
<tab label="&pane3.tab4.title;"/>
356-
<tab label="&pane3.tab5.title;"/>
357-
<tab label="&pane3.tab6.title;"/>
358-
<tab label="&pane3.tab7.title;"/>
352+
<tab label="&pane3.tab1.title;" value="left"/>
353+
<tab label="&pane3.tab2.title;" value="middle"/>
354+
<tab label="&pane3.tab3.title;" value="right"/>
355+
<tab label="&pane3.tab4.title;" value="dbl"/>
356+
<tab label="&pane3.tab5.title;" value="ctrl"/>
357+
<tab label="&pane3.tab6.title;" value="alt"/>
358+
<tab label="&pane3.tab7.title;" value="shift"/>
359359
</tabs>
360360
<tabpanels>
361361
<tabpanel orient="vertical">
@@ -1169,14 +1169,13 @@
11691169
11701170
function onTabClickingTabSelect() {
11711171
var target = $("tabClickingTabs");
1172-
var tabs = ["left", "middle", "right", "dbl", "ctrl", "alt", "shift"];
11731172
11741173
$("c.clickBookmarks").selectedIndex = target.selectedIndex;
11751174
$("c.clickLinks").selectedIndex = target.selectedIndex;
11761175
$("l.clickTab").selectedIndex = target.selectedIndex ? 1 : 0;
11771176
11781177
["c.clickTab", "c.clickTabBar", "c.clickNewTabButton"].forEach(function(aId) {
1179-
var prefName = tabs[target.selectedIndex] + aId.split(".")[1].replace(/./, function(s) s.toUpperCase());
1178+
var prefName = target.selectedItem.value + aId.split(".")[1].replace(/./, function(s) s.toUpperCase());
11801179
var preference = $(prefName);
11811180
var element = $(aId);
11821181
if (preference) {
@@ -1190,8 +1189,8 @@
11901189
setDisabled(aId.replace("c", "b"), !element.hasAttribute("preference"));
11911190
});
11921191
1193-
setDisabled("b.clickBookmarks", ["middle", "right", "ctrl", "shift"].indexOf(tabs[target.selectedIndex]) == -1);
1194-
setDisabled("b.clickLinks", ["middle", "right", "ctrl", "shift"].indexOf(tabs[target.selectedIndex]) == -1);
1192+
setDisabled("b.clickBookmarks", ["middle", "right", "ctrl", "shift"].indexOf(target.selectedItem.value) == -1);
1193+
setDisabled("b.clickLinks", ["middle", "right", "ctrl", "shift"].indexOf(target.selectedItem.value) == -1);
11951194
setDisabled("b.clickCurrentTab", target.selectedIndex > 0);
11961195
}
11971196

0 commit comments

Comments
 (0)