Bug 192447: correctly disable the Advanced button when js is disabled.

original patch by norority.
This commit is contained in:
chanial%noos.fr 2003-02-27 18:53:51 +00:00
Родитель 407f5b970f
Коммит 9c3b9e0612
2 изменённых файлов: 6 добавлений и 4 удалений

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

@ -51,6 +51,7 @@ function Startup()
var imagesEnabled = document.getElementById("enableImages").checked; var imagesEnabled = document.getElementById("enableImages").checked;
var imageBroadcaster = document.getElementById("imageBroadcaster"); var imageBroadcaster = document.getElementById("imageBroadcaster");
imageBroadcaster.setAttribute("disabled", !imagesEnabled); imageBroadcaster.setAttribute("disabled", !imagesEnabled);
javascriptEnabledChange()
} }
function viewImages() function viewImages()
@ -65,10 +66,11 @@ function advancedJavaScript()
"chrome,modal"); "chrome,modal");
} }
function javascriptEnabledChange(aEnable){ function javascriptEnabledChange()
var label = document.getElementById("allowScripts"); {
var isEnabled = document.getElementById("enableJavaScript").checked;
var advancedButton = document.getElementById("advancedJavascript"); var advancedButton = document.getElementById("advancedJavascript");
advancedButton.disabled = aEnable; advancedButton.disabled = !isEnabled;
} }
function togglePermissionEnabling() function togglePermissionEnabling()

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

@ -89,7 +89,7 @@
<hbox> <hbox>
<checkbox id="enableJavaScript" label="&enableJavaScript.label;" accesskey="&enableJavaScript.accesskey;" <checkbox id="enableJavaScript" label="&enableJavaScript.label;" accesskey="&enableJavaScript.accesskey;"
prefstring="javascript.enabled" prefstring="javascript.enabled"
oncommand="javascriptEnabledChange(!this.checked);"/> oncommand="javascriptEnabledChange();"/>
<spring flex="1"/> <spring flex="1"/>
<checkbox id="allowWindowMoveResize" prefstring="dom.disable_window_move_resize" hidden="true"/> <checkbox id="allowWindowMoveResize" prefstring="dom.disable_window_move_resize" hidden="true"/>