Skip to content

Commit 2fadb98

Browse files
committed
Tab highlighting tabs cleanup
1 parent 6850223 commit 2fadb98

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

chrome/content/preferences.xul

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,11 @@
606606
<caption label="&highlight.caption;"/>
607607
<tabbox>
608608
<tabs id="highlight" onselect="onHighlightTabSelect();">
609-
<tab label="&highlight.tab1.label;" observes="b.highlightCurrent"/>
610-
<tab label="&highlight.tab2.label;" observes="b.highlightUnread"/>
611-
<tab label="&highlight.tab3.label;" observes="b.highlightRead"/>
612-
<tab label="&highlight.tab6.label;" observes="b.highlightUnloaded"/>
613-
<tab label="&highlight.tab7.label;" observes="b.highlightSelected"/>
609+
<tab label="&highlight.tab1.label;" value="Current" observes="b.highlightCurrent"/>
610+
<tab label="&highlight.tab2.label;" value="Unread" observes="b.highlightUnread"/>
611+
<tab label="&highlight.tab3.label;" value="Read" observes="b.highlightRead"/>
612+
<tab label="&highlight.tab6.label;" value="Unloaded" observes="b.highlightUnloaded"/>
613+
<tab label="&highlight.tab7.label;" value="Selected" observes="b.highlightSelected"/>
614614
</tabs>
615615
<tabpanels>
616616
<tabpanel orient="vertical">
@@ -1195,18 +1195,16 @@
11951195
}
11961196
11971197
function onHighlightTabSelect() {
1198-
var target = $("highlight");
1199-
var tabs = ["Current", "Unread", "Read", "Unloaded", "Selected"];
1198+
var prefName = $("highlight").selectedItem.value;
12001199
1201-
$("c.highlightEnabled").setAttribute("preference", "highlight" + tabs[target.selectedIndex]);
1202-
$("c.highlightEnabled").checked = $("highlight" + tabs[target.selectedIndex]).value;
1200+
$("c.highlightEnabled").setAttribute("preference", "highlight" + prefName);
1201+
$("c.highlightEnabled").checked = $("highlight" + prefName).value;
12031202
1204-
onHighlightEnabled(tabs[target.selectedIndex]);
1203+
onHighlightEnabled(prefName);
12051204
}
12061205
12071206
function onHighlightEnabled(item) {
1208-
var tabs = ["Current", "Unread", "Read", "Unloaded", "Selected"];
1209-
if (item == tabs[$("highlight").selectedIndex]) {
1207+
if (item == $("highlight").selectedItem.value) {
12101208
setDisabled("b.highlightEnabled", !$("highlight" + item).value);
12111209
}
12121210
@@ -1233,8 +1231,7 @@
12331231
: ""
12341232
);
12351233
1236-
var tabs = ["Current", "Unread", "Read", "Unloaded", "Selected"];
1237-
if (item == tabs[$("highlight").selectedIndex]) {
1234+
if (item == $("highlight").selectedItem.value) {
12381235
$("c.highlightBold").checked = style.bold;
12391236
$("c.highlightItalic").checked = style.italic;
12401237
$("c.highlightUnderline").checked = style.underline;
@@ -1274,8 +1271,7 @@
12741271
opacityCode: $("c.highlightOpacityCode").value / 100
12751272
};
12761273
1277-
var tabs = ["Current", "Unread", "Read", "Unloaded", "Selected"];
1278-
$("style" + tabs[$("highlight").selectedIndex]).value = JSON.stringify(style);
1274+
$("style" + $("highlight").selectedItem.value).value = JSON.stringify(style);
12791275
}
12801276
12811277
function onHighlightColor() {

0 commit comments

Comments
 (0)