зеркало из https://github.com/mozilla/pjs.git
Bug 413437 - Locking homepage buttons to disable them is broken. patch from Michael Schonfeld <dev@schonfeld.org>, r=me.
This commit is contained in:
Родитель
c85a55a737
Коммит
2b62bd839d
|
@ -131,6 +131,7 @@ var gMainPane = {
|
||||||
_updateUseCurrentButton: function () {
|
_updateUseCurrentButton: function () {
|
||||||
var useCurrent = document.getElementById("useCurrent");
|
var useCurrent = document.getElementById("useCurrent");
|
||||||
|
|
||||||
|
var windowIsPresent;
|
||||||
var win;
|
var win;
|
||||||
if (document.documentElement.instantApply) {
|
if (document.documentElement.instantApply) {
|
||||||
const Cc = Components.classes, Ci = Components.interfaces;
|
const Cc = Components.classes, Ci = Components.interfaces;
|
||||||
|
@ -144,7 +145,7 @@ var gMainPane = {
|
||||||
|
|
||||||
if (win && win.document.documentElement
|
if (win && win.document.documentElement
|
||||||
.getAttribute("windowtype") == "navigator:browser") {
|
.getAttribute("windowtype") == "navigator:browser") {
|
||||||
useCurrent.disabled = false;
|
windowIsPresent = true;
|
||||||
|
|
||||||
var tabbrowser = win.document.getElementById("content");
|
var tabbrowser = win.document.getElementById("content");
|
||||||
if (tabbrowser.browsers.length > 1)
|
if (tabbrowser.browsers.length > 1)
|
||||||
|
@ -153,9 +154,16 @@ var gMainPane = {
|
||||||
useCurrent.label = useCurrent.getAttribute("label1");
|
useCurrent.label = useCurrent.getAttribute("label1");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
windowIsPresent = false;
|
||||||
useCurrent.label = useCurrent.getAttribute("label1");
|
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;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Загрузка…
Ссылка в новой задаче