From 842f47493946e31bb0914f11c91a70a6680255c5 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Wed, 26 Apr 2023 14:26:37 +0200 Subject: [PATCH] Remove shadow root from StyleConfigurator #3082 Also renamed style-configurator.scss -> styleConfigurator.scss --- .../zotero/elements/styleConfigurator.js | 67 +++++++------------ scss/_zotero.scss | 1 + scss/elements/_styleConfigurator.scss | 56 ++++++++++++++++ scss/elements/style-configurator.scss | 58 ---------------- 4 files changed, 80 insertions(+), 102 deletions(-) create mode 100644 scss/elements/_styleConfigurator.scss delete mode 100644 scss/elements/style-configurator.scss diff --git a/chrome/content/zotero/elements/styleConfigurator.js b/chrome/content/zotero/elements/styleConfigurator.js index 3ac1e52b3a..d97293e5dc 100644 --- a/chrome/content/zotero/elements/styleConfigurator.js +++ b/chrome/content/zotero/elements/styleConfigurator.js @@ -29,13 +29,6 @@ Services.scriptloader.loadSubScript("chrome://zotero/content/elements/base.js", this); class StyleSelector extends XULElementBase { - get stylesheets() { - return [ - 'chrome://global/skin/global.css', - 'chrome://zotero/skin/elements/style-configurator.css' - ]; - } - content = MozXULElement.parseXULToFragment(`
{ const value = so.styleID; @@ -72,7 +65,7 @@ `)); }); this.value = this.getAttribute('value'); - this.shadowRoot.getElementById('style-list').addEventListener("select", () => { + this.querySelector('#style-list').addEventListener("select", () => { const event = document.createEvent("Events"); event.initEvent("select", true, true); this.dispatchEvent(event); @@ -94,13 +87,6 @@
`); - get stylesheets() { - return [ - 'chrome://global/skin/global.css', - 'chrome://zotero/skin/elements/style-configurator.css' - ]; - } - get value() { return this.localeListEl.value; } @@ -124,8 +110,8 @@ connectedCallback() { super.connectedCallback(); - this.localeListEl = this.shadowRoot.getElementById('locale-list'); - this.localePopupEl = this.shadowRoot.querySelector('#locale-list > menupopup'); + this.localeListEl = this.querySelector('#locale-list'); + this.localePopupEl = this.querySelector('#locale-list > menupopup'); } async init() { @@ -166,15 +152,15 @@ class StyleConfigurator extends XULElementBase { content = MozXULElement.parseXULToFragment(` -