Bug 1482351 - Add placeholder for calendar preferences, and remove it if Lightning is not enabled. r=aceman,MakeMyDay

This commit is contained in:
Geoff Lankow 2018-09-09 15:21:58 +12:00
Родитель 274345af14
Коммит 35d55a8af9
3 изменённых файлов: 11 добавлений и 7 удалений

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

@ -16,13 +16,8 @@ var gLightningPane = {
ltnPrefs.addEventListener("select", gLightningPane.tabSelectionChanged.bind(this)); ltnPrefs.addEventListener("select", gLightningPane.tabSelectionChanged.bind(this));
this.mInitialized = true; this.mInitialized = true;
let prefTab = document.documentElement; let categoryButton = document.querySelector('#category-box radio[pane="paneLightning"]');
let lightningButton = prefTab._makePaneButton(document.getElementById("paneLightning")); categoryButton.label = document.getElementById("paneLightning").label;
let advancedButton = document.querySelector('#category-box radio[pane="paneAdvanced"]');
advancedButton.parentNode.insertBefore(lightningButton, advancedButton);
// We probably messed this up just by existing. Fix it.
prefTab._paneDeck.selectedIndex = prefTab._selector.selectedIndex;
let elements = document.querySelectorAll("#paneLightning preference"); let elements = document.querySelectorAll("#paneLightning preference");
for (let element of elements) { for (let element of elements) {

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

@ -52,5 +52,6 @@
#include privacy.inc.xul #include privacy.inc.xul
#include security.inc.xul #include security.inc.xul
#include applications.inc.xul #include applications.inc.xul
<prefpane id="paneLightning"/>
#include advanced.inc.xul #include advanced.inc.xul
</preftab> </preftab>

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

@ -5,6 +5,7 @@
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource:///modules/MailServices.jsm"); ChromeUtils.import("resource:///modules/MailServices.jsm");
ChromeUtils.import("resource:///modules/extensionSupport.jsm");
window.addEventListener("load", function() { window.addEventListener("load", function() {
let prefWindow = document.getElementById("MailPreferences"); let prefWindow = document.getElementById("MailPreferences");
@ -15,6 +16,13 @@ window.addEventListener("load", function() {
prefWindow.showPane(document.getElementById("paneGeneral")); prefWindow.showPane(document.getElementById("paneGeneral"));
radio.hidden = true; radio.hidden = true;
} }
if (!ExtensionSupport.loadedLegacyExtensions.has("{e2fda1a4-762b-4020-b5ad-a41df1933103}")) {
let radio =
document.getAnonymousElementByAttribute(prefWindow, "pane", "paneLightning");
if (radio.selected)
prefWindow.showPane(document.getElementById("paneGeneral"));
radio.hidden = true;
}
}); });
/** /**