mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 01:10:12 +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) {
|
||||
let content = kZenStylesheetThemeHeader;
|
||||
for (let theme of themes) {
|
||||
if (theme.disabled) {
|
||||
if (!theme.enabled) {
|
||||
continue;
|
||||
}
|
||||
content += this.getThemeCSS(theme);
|
||||
|
@ -147,6 +147,16 @@ var gZenThemeImporter = new (class {
|
|||
for (const theme of Object.values(await this.getThemes())) {
|
||||
const { preferences, areOldPreferences } = await this._getThemePreferences(theme);
|
||||
|
||||
if (!theme.enabled) {
|
||||
const element = browser.document.getElementById(theme.name);
|
||||
|
||||
if (element) {
|
||||
element.remove()
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (areOldPreferences) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue