mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 16:30:01 +02:00
Fixed themes glitching
This commit is contained in:
parent
ff7a75998b
commit
d7715eb754
1 changed files with 9 additions and 9 deletions
|
@ -83,9 +83,9 @@ var gZenThemeImporter = new (class {
|
||||||
return this._themes;
|
return this._themes;
|
||||||
}
|
}
|
||||||
|
|
||||||
rebuildThemeStylesheet() {
|
async rebuildThemeStylesheet() {
|
||||||
this._themes = null;
|
this._themes = null;
|
||||||
this.updateStylesheet();
|
await this.updateStylesheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
get styleSheetURI() {
|
get styleSheetURI() {
|
||||||
|
@ -99,21 +99,21 @@ var gZenThemeImporter = new (class {
|
||||||
return Services.io.newFileURI(new FileUtils.File(PathUtils.join(this.getThemeFolder(theme), 'chrome.css')));
|
return Services.io.newFileURI(new FileUtils.File(PathUtils.join(this.getThemeFolder(theme), 'chrome.css')));
|
||||||
}
|
}
|
||||||
|
|
||||||
insertStylesheet() {
|
async insertStylesheet() {
|
||||||
if (IOUtils.exists(this.styleSheetPath)) {
|
if (await IOUtils.exists(this.styleSheetPath)) {
|
||||||
this.sss.loadAndRegisterSheet(this.styleSheetURI, this.sss.AGENT_SHEET);
|
await this.sss.loadAndRegisterSheet(this.styleSheetURI, this.sss.AGENT_SHEET);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
removeStylesheet() {
|
async removeStylesheet() {
|
||||||
this.sss.unregisterSheet(this.styleSheetURI, this.sss.AGENT_SHEET);
|
await this.sss.unregisterSheet(this.styleSheetURI, this.sss.AGENT_SHEET);
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateStylesheet() {
|
async updateStylesheet() {
|
||||||
this.removeStylesheet();
|
await this.removeStylesheet();
|
||||||
await this.writeStylesheet();
|
await this.writeStylesheet();
|
||||||
await this.writeToDom();
|
await this.writeToDom();
|
||||||
this.insertStylesheet();
|
await this.insertStylesheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
_getBrowser() {
|
_getBrowser() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue