mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 14:59:59 +02:00
refactor(zenThemesImporter): renamed disabled to enabled
- remove dom elements on enabled = false
This commit is contained in:
parent
4d8d109e78
commit
304b688473
1 changed files with 11 additions and 1 deletions
|
@ -12,7 +12,7 @@ var gZenStylesheetManager = {
|
||||||
async writeStylesheet(path, themes) {
|
async writeStylesheet(path, themes) {
|
||||||
let content = kZenStylesheetThemeHeader;
|
let content = kZenStylesheetThemeHeader;
|
||||||
for (let theme of themes) {
|
for (let theme of themes) {
|
||||||
if (theme.disabled) {
|
if (!theme.enabled) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
content += this.getThemeCSS(theme);
|
content += this.getThemeCSS(theme);
|
||||||
|
@ -147,6 +147,16 @@ var gZenThemeImporter = new (class {
|
||||||
for (const theme of Object.values(await this.getThemes())) {
|
for (const theme of Object.values(await this.getThemes())) {
|
||||||
const { preferences, areOldPreferences } = await this._getThemePreferences(theme);
|
const { preferences, areOldPreferences } = await this._getThemePreferences(theme);
|
||||||
|
|
||||||
|
if (!theme.enabled) {
|
||||||
|
const element = browser.document.getElementById(theme.name);
|
||||||
|
|
||||||
|
if (element) {
|
||||||
|
element.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (areOldPreferences) {
|
if (areOldPreferences) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue