Bug 311496 - Safe Mode UI: 'Make Changes and Restart' button should be disabled if no action is checked, r=mconnor.

This commit is contained in:
mozilla.mano%sent.com 2006-06-10 14:10:27 +00:00
Родитель 058e40f1fd
Коммит d25fff9774
2 изменённых файлов: 18 добавлений и 2 удалений

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

@ -21,6 +21,7 @@
#
# Contributor(s):
# Mike Connor <mconnor@steelgryphon.com>
# Asaf Romano <mozilla.mano@sent.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -102,3 +103,16 @@ function onCancel() {
.getService(Components.interfaces.nsIAppStartup);
appStartup.quit(appStartup.eForceQuit);
}
function onLoad() {
document.getElementById("tasks")
.addEventListener("CheckboxStateChange", UpdateOKButtonState, false);
}
function UpdateOKButtonState() {
document.documentElement.getButton("accept").disabled =
!document.getElementById("resetUserPrefs").checked &&
!document.getElementById("resetBookmarks").checked &&
!document.getElementById("resetToolbars").checked &&
!document.getElementById("disableAddons").checked;
}

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

@ -63,7 +63,9 @@
width="&window.width;"
ondialogaccept="onOK()"
ondialogcancel="onCancel()"
ondialogextra1="window.close()">
ondialogextra1="window.close()"
onload="onLoad();"
buttondisabledaccept="true">
<script type="application/x-javascript" src="chrome://browser/content/safeMode.js"/>
@ -74,7 +76,7 @@
<separator class="thin"/>
<label value="&safeModeDescription2.label;"/>
<vbox>
<vbox id="tasks">
<checkbox id="disableAddons" label="&disableAddons.label;" accesskey="&disableAddons.accesskey;"/>
<checkbox id="resetToolbars" label="&resetToolbars.label;" accesskey="&resetToolbars.accesskey;"/>
<checkbox id="resetBookmarks" label="&resetBookmarks.label;" accesskey="&resetBookmarks.accesskey;"/>