mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 20:37:31 +09:00
[PALEMOON] buildHelpMenu() is executed by the shared help menu but not all windows have the AppMenu
This commit is contained in:
parent
e164082a5a
commit
e0171dc973
1 changed files with 25 additions and 7 deletions
|
|
@ -584,10 +584,16 @@ function buildHelpMenu()
|
||||||
var checkForUpdates = document.getElementById("checkForUpdates");
|
var checkForUpdates = document.getElementById("checkForUpdates");
|
||||||
var appMenuCheckForUpdates = document.getElementById("appmenu_checkForUpdates");
|
var appMenuCheckForUpdates = document.getElementById("appmenu_checkForUpdates");
|
||||||
var canCheckForUpdates = updates.canCheckForUpdates;
|
var canCheckForUpdates = updates.canCheckForUpdates;
|
||||||
|
|
||||||
checkForUpdates.setAttribute("disabled", !canCheckForUpdates);
|
checkForUpdates.setAttribute("disabled", !canCheckForUpdates);
|
||||||
appMenuCheckForUpdates.setAttribute("disabled", !canCheckForUpdates);
|
|
||||||
if (!canCheckForUpdates)
|
if (appMenuCheckForUpdates) {
|
||||||
|
appMenuCheckForUpdates.setAttribute("disabled", !canCheckForUpdates);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!canCheckForUpdates) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var strings = document.getElementById("bundle_browser");
|
var strings = document.getElementById("bundle_browser");
|
||||||
var activeUpdate = um.activeUpdate;
|
var activeUpdate = um.activeUpdate;
|
||||||
|
|
@ -623,19 +629,31 @@ function buildHelpMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
checkForUpdates.label = getStringWithUpdateName("updatesItem_" + key);
|
checkForUpdates.label = getStringWithUpdateName("updatesItem_" + key);
|
||||||
appMenuCheckForUpdates.label = getStringWithUpdateName("updatesItem_" + key);
|
|
||||||
|
if (appMenuCheckForUpdates) {
|
||||||
|
appMenuCheckForUpdates.label = getStringWithUpdateName("updatesItem_" + key);
|
||||||
|
}
|
||||||
|
|
||||||
// updatesItem_default.accesskey, updatesItem_downloading.accesskey,
|
// updatesItem_default.accesskey, updatesItem_downloading.accesskey,
|
||||||
// updatesItem_resume.accesskey or updatesItem_pending.accesskey
|
// updatesItem_resume.accesskey or updatesItem_pending.accesskey
|
||||||
checkForUpdates.accessKey = strings.getString("updatesItem_" + key +
|
checkForUpdates.accessKey = strings.getString("updatesItem_" + key +
|
||||||
".accesskey");
|
".accesskey");
|
||||||
appMenuCheckForUpdates.accessKey = strings.getString("updatesItem_" + key +
|
|
||||||
".accesskey");
|
if (appMenuCheckForUpdates) {
|
||||||
|
appMenuCheckForUpdates.accessKey = strings.getString("updatesItem_" + key +
|
||||||
|
".accesskey");
|
||||||
|
}
|
||||||
|
|
||||||
if (um.activeUpdate && updates.isDownloading) {
|
if (um.activeUpdate && updates.isDownloading) {
|
||||||
checkForUpdates.setAttribute("loading", "true");
|
checkForUpdates.setAttribute("loading", "true");
|
||||||
appMenuCheckForUpdates.setAttribute("loading", "true");
|
if (appMenuCheckForUpdates) {
|
||||||
|
appMenuCheckForUpdates.setAttribute("loading", "true");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
checkForUpdates.removeAttribute("loading");
|
checkForUpdates.removeAttribute("loading");
|
||||||
appMenuCheckForUpdates.removeAttribute("loading");
|
if (appMenuCheckForUpdates) {
|
||||||
|
appMenuCheckForUpdates.removeAttribute("loading");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifndef XP_MACOSX
|
#ifndef XP_MACOSX
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue