Bug 887256 - Show the 'Restart Now' link only once and reduce paddings and margins from Options Panel, r=jwalker

This commit is contained in:
Girish Sharma 2013-06-30 04:32:16 +05:30
Родитель b781d179b5
Коммит d47beba39d
4 изменённых файлов: 28 добавлений и 17 удалений

Просмотреть файл

@ -181,19 +181,15 @@ OptionsPanel.prototype = {
}, },
/** /**
* Hides any label in a box with class "hidden-labels-box" at page load. The * Handles checkbox click inside hbox with class "hidden-labels-box". The
* labels are shown again when the user click on the checkbox in the box. * labels inside the hbox are shown again when the user click on the checkbox
* in the box.
*/ */
prepareRestartPreferences: function() { prepareRestartPreferences: function() {
let labels = this.panelDoc.querySelectorAll(".hidden-labels-box > label");
for (let label of labels) {
label.style.display = "none";
}
let checkboxes = this.panelDoc.querySelectorAll(".hidden-labels-box > checkbox"); let checkboxes = this.panelDoc.querySelectorAll(".hidden-labels-box > checkbox");
for (let checkbox of checkboxes) { for (let checkbox of checkboxes) {
checkbox.addEventListener("command", function(target) { checkbox.addEventListener("command", function(target) {
target.nextSibling.style.display = ""; target.parentNode.classList.toggle("visible");
target.nextSibling.nextSibling.style.display = "";
}.bind(null, checkbox)); }.bind(null, checkbox));
} }
}, },

Просмотреть файл

@ -253,20 +253,20 @@
} }
.options-vertical-pane { .options-vertical-pane {
margin: 15px; margin: 5px;
width: calc(50% - 30px); width: calc(50% - 30px);
min-width: 400px; min-width: 400px;
-moz-padding-start: 5px; -moz-padding-start: 5px;
} }
.options-vertical-pane > label { .options-vertical-pane > label {
padding: 5px 0; padding: 2px 0;
font-size: 1.4rem; font-size: 1.4rem;
} }
.options-groupbox { .options-groupbox {
-moz-margin-start: 15px; -moz-margin-start: 15px;
padding: 4px; padding: 2px;
} }
.options-groupbox > * { .options-groupbox > * {
@ -285,3 +285,8 @@
padding: 3px 0 0 !important; /* To align it with the checkbox */ padding: 3px 0 0 !important; /* To align it with the checkbox */
font-style: italic; font-style: italic;
} }
.hidden-labels-box:not(.visible) > label,
.hidden-labels-box.visible ~ .hidden-labels-box > label:last-child {
display: none;
}

Просмотреть файл

@ -239,20 +239,20 @@
} }
.options-vertical-pane { .options-vertical-pane {
margin: 15px; margin: 5px;
width: calc(50% - 30px); width: calc(50% - 30px);
min-width: 400px; min-width: 400px;
-moz-padding-start: 5px; -moz-padding-start: 5px;
} }
.options-vertical-pane > label { .options-vertical-pane > label {
padding: 5px 0; padding: 2px 0;
font-size: 1.4rem; font-size: 1.4rem;
} }
.options-groupbox { .options-groupbox {
-moz-margin-start: 15px; -moz-margin-start: 15px;
padding: 4px; padding: 2px;
} }
.options-groupbox > * { .options-groupbox > * {
@ -271,3 +271,8 @@
padding: 3px 0 0 !important; /* To align it with the checkbox */ padding: 3px 0 0 !important; /* To align it with the checkbox */
font-style: italic; font-style: italic;
} }
.hidden-labels-box:not(.visible) > label,
.hidden-labels-box.visible ~ .hidden-labels-box > label:last-child {
display: none;
}

Просмотреть файл

@ -248,20 +248,20 @@
} }
.options-vertical-pane { .options-vertical-pane {
margin: 15px; margin: 5px;
width: calc(50% - 30px); width: calc(50% - 30px);
min-width: 400px; min-width: 400px;
-moz-padding-start: 5px; -moz-padding-start: 5px;
} }
.options-vertical-pane > label { .options-vertical-pane > label {
padding: 5px 0; padding: 2px 0;
font-size: 1.4rem; font-size: 1.4rem;
} }
.options-groupbox { .options-groupbox {
-moz-margin-start: 15px; -moz-margin-start: 15px;
padding: 4px; padding: 2px;
} }
.options-groupbox > * { .options-groupbox > * {
@ -280,3 +280,8 @@
padding: 3px 0 0 !important; /* To align it with the checkbox */ padding: 3px 0 0 !important; /* To align it with the checkbox */
font-style: italic; font-style: italic;
} }
.hidden-labels-box:not(.visible) > label,
.hidden-labels-box.visible ~ .hidden-labels-box > label:last-child {
display: none;
}