From 35d55a8af90bfc1d4e59ef4ba187316e545b5e5a Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Sun, 9 Sep 2018 15:21:58 +1200 Subject: [PATCH] Bug 1482351 - Add placeholder for calendar preferences, and remove it if Lightning is not enabled. r=aceman,MakeMyDay --- .../lightning/content/messenger-overlay-preferences.js | 9 ++------- mail/components/preferences/aboutPreferences.xul | 1 + mail/components/preferences/preferences.js | 8 ++++++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/calendar/lightning/content/messenger-overlay-preferences.js b/calendar/lightning/content/messenger-overlay-preferences.js index cfd254a2b3..c2cd68dede 100644 --- a/calendar/lightning/content/messenger-overlay-preferences.js +++ b/calendar/lightning/content/messenger-overlay-preferences.js @@ -16,13 +16,8 @@ var gLightningPane = { ltnPrefs.addEventListener("select", gLightningPane.tabSelectionChanged.bind(this)); this.mInitialized = true; - let prefTab = document.documentElement; - let lightningButton = prefTab._makePaneButton(document.getElementById("paneLightning")); - 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 categoryButton = document.querySelector('#category-box radio[pane="paneLightning"]'); + categoryButton.label = document.getElementById("paneLightning").label; let elements = document.querySelectorAll("#paneLightning preference"); for (let element of elements) { diff --git a/mail/components/preferences/aboutPreferences.xul b/mail/components/preferences/aboutPreferences.xul index e095c2e6db..d045af026a 100644 --- a/mail/components/preferences/aboutPreferences.xul +++ b/mail/components/preferences/aboutPreferences.xul @@ -52,5 +52,6 @@ #include privacy.inc.xul #include security.inc.xul #include applications.inc.xul + #include advanced.inc.xul diff --git a/mail/components/preferences/preferences.js b/mail/components/preferences/preferences.js index e292139dd9..2ad59c87cc 100644 --- a/mail/components/preferences/preferences.js +++ b/mail/components/preferences/preferences.js @@ -5,6 +5,7 @@ ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); ChromeUtils.import("resource:///modules/MailServices.jsm"); +ChromeUtils.import("resource:///modules/extensionSupport.jsm"); window.addEventListener("load", function() { let prefWindow = document.getElementById("MailPreferences"); @@ -15,6 +16,13 @@ window.addEventListener("load", function() { prefWindow.showPane(document.getElementById("paneGeneral")); 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; + } }); /**