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:
parent
d9c2559b21
commit
0acc4234aa
2 changed files with 12 additions and 0 deletions
|
@ -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];
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue