3a3ecabe
Imshann
init
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
this.styleSheets = null;
this.createStyle = function (key, style) {
if (!document.querySelector("#antd")) {
let styleElement = document.createElement("style");
styleElement.setAttribute("id", "antd");
styleElement.setAttribute("type", "text/css");
styleElement.innerHTML = baseStyle.toString();
document.head.appendChild(styleElement);
}
if (!document.querySelector("#" + key)) {
let styleElement = document.createElement("style");
styleElement.setAttribute("id", key);
styleElement.setAttribute("type", "text/css");
styleElement.innerHTML = style.toString();
document.head.appendChild(styleElement);
if (this.styleSheets) {
this.disableStyle(key);
}
}
};
this.disableStyle = function (name) {
for (let i = 0; i < this.styleSheets.cssRules.length; i++) {
let rule = this.styleSheets.cssRules[i];
|