Bug 413437 - Locking homepage buttons to disable them is broken. patch from Michael Schonfeld <dev@schonfeld.org>, r=me.

This commit is contained in:
mozilla.mano@sent.com 2008-02-12 11:19:26 -08:00
parent 5fb2f28e98
commit c0a06d2b9a

View File

@ -131,6 +131,7 @@ var gMainPane = {
_updateUseCurrentButton: function () {
var useCurrent = document.getElementById("useCurrent");
var windowIsPresent;
var win;
if (document.documentElement.instantApply) {
const Cc = Components.classes, Ci = Components.interfaces;
@ -144,7 +145,7 @@ var gMainPane = {
if (win && win.document.documentElement
.getAttribute("windowtype") == "navigator:browser") {
useCurrent.disabled = false;
windowIsPresent = true;
var tabbrowser = win.document.getElementById("content");
if (tabbrowser.browsers.length > 1)
@ -153,9 +154,16 @@ var gMainPane = {
useCurrent.label = useCurrent.getAttribute("label1");
}
else {
windowIsPresent = false;
useCurrent.label = useCurrent.getAttribute("label1");
useCurrent.disabled = true;
}
// In this case, the button's disabled state is set by preferences.xml.
if (document.getElementById
("pref.browser.homepage.disable_button.current_page").locked)
return;
useCurrent.disabled = !windowIsPresent;
},
/**