1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00

Added removeOverride() in rendition.themes to remove a css property in rendition.themes._overrides

This commit is contained in:
Nicolas Segarra 2019-08-17 00:29:34 +08:00
parent d9c2559b21
commit 0acc4234aa
2 changed files with 12 additions and 0 deletions

View file

@ -261,6 +261,8 @@ class Contents {
if (value) { if (value) {
content.style.setProperty(property, value, priority ? "important" : ""); content.style.setProperty(property, value, priority ? "important" : "");
} else {
content.style.removeProperty(property);
} }
return this.window.getComputedStyle(content)[property]; return this.window.getComputedStyle(content)[property];

View file

@ -202,6 +202,16 @@ class Themes {
}); });
} }
removeOverride (name) {
var contents = this.rendition.getContents();
delete this._overrides[name];
contents.forEach( (content) => {
content.css(name);
});
}
/** /**
* Add all overrides * Add all overrides
* @param {Content} content * @param {Content} content