mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-11-22 11:52:09 +03:00
remove console logs from cssom.js
This commit is contained in:
parent
13364449da
commit
5994449bb1
@ -2,7 +2,6 @@
|
|||||||
var ruleCache = new Set()
|
var ruleCache = new Set()
|
||||||
|
|
||||||
function createStyleNode() {
|
function createStyleNode() {
|
||||||
|
|
||||||
const node = document.createElement('style')
|
const node = document.createElement('style')
|
||||||
// Without it, IE will have a broken source order specificity if we
|
// Without it, IE will have a broken source order specificity if we
|
||||||
// insert rules after we insert the style tag.
|
// insert rules after we insert the style tag.
|
||||||
@ -12,12 +11,9 @@
|
|||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var staticSheet = createStyleNode();
|
var staticSheet = createStyleNode();
|
||||||
var sheet = createStyleNode().sheet;
|
var sheet = createStyleNode().sheet;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sync_static(newStyleString) {
|
function sync_static(newStyleString) {
|
||||||
staticSheet.textContent = newStyleString
|
staticSheet.textContent = newStyleString
|
||||||
}
|
}
|
||||||
@ -29,70 +25,23 @@
|
|||||||
for (var i = 0; i < newRule.length; i++) {
|
for (var i = 0; i < newRule.length; i++) {
|
||||||
sheet.insertRule(newRule[i])
|
sheet.insertRule(newRule[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
ruleCache.add(key)
|
ruleCache.add(key)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class CssRulesNode extends HTMLElement {
|
class CssRulesNode extends HTMLElement {
|
||||||
constructor() {
|
|
||||||
var self = super();
|
|
||||||
}
|
|
||||||
connectedCallback() {
|
|
||||||
sync(this.rulesPayload)
|
|
||||||
}
|
|
||||||
set rules(rules) {
|
set rules(rules) {
|
||||||
console.log("set rules")
|
sync(rules);
|
||||||
console.log(rules)
|
|
||||||
if (self.rulesPayload) {
|
|
||||||
console.log(self.rulesPayload)
|
|
||||||
}
|
|
||||||
this._rules = rules;
|
|
||||||
console.log(this._rules)
|
|
||||||
}
|
|
||||||
attributeChangedCallback(attrName, oldVal, newVal) {
|
|
||||||
console.log(attrName, oldVal, newVal)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
customElements.define('elm-ui-rules', CssRulesNode);
|
customElements.define('elm-ui-rules', CssRulesNode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CssStaticRulesNode extends HTMLElement {
|
class CssStaticRulesNode extends HTMLElement {
|
||||||
constructor() {
|
|
||||||
var self = super();
|
|
||||||
this._rules = null;
|
|
||||||
}
|
|
||||||
connectedCallback() {
|
|
||||||
// console.log("static connected")
|
|
||||||
// console.log(this)
|
|
||||||
// if (this._rules) {
|
|
||||||
// sync_static(this._rules)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
set rules(rules) {
|
set rules(rules) {
|
||||||
this._rules = rules
|
sync_static(rules);
|
||||||
sync_static(this._rules)
|
|
||||||
// console.log("set static rules")
|
|
||||||
// console.log(rules)
|
|
||||||
}
|
|
||||||
|
|
||||||
attributeChangedCallback(attrName, oldVal, newVal) {
|
|
||||||
console.log("attribute cng")
|
|
||||||
console.log(attrName)
|
|
||||||
if (attrName == "rules") {
|
|
||||||
sync_static(newVal)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
customElements.define('elm-ui-static-rules', CssStaticRulesNode);
|
customElements.define('elm-ui-static-rules', CssStaticRulesNode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}())
|
}())
|
||||||
|
Loading…
Reference in New Issue
Block a user