fix autoSpacing
to take effect after DOM ready
This commit is contained in:
parent
eadee6a3b7
commit
c82e86bc4b
1 changed files with 4 additions and 2 deletions
|
@ -118,13 +118,15 @@ class Heti {
|
||||||
}
|
}
|
||||||
|
|
||||||
autoSpacing () {
|
autoSpacing () {
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
const callback = () => {
|
||||||
const $$rootList = document.querySelectorAll(this.rootSelector)
|
const $$rootList = document.querySelectorAll(this.rootSelector)
|
||||||
|
|
||||||
for (let $$root of $$rootList) {
|
for (let $$root of $$rootList) {
|
||||||
this.spacingElement($$root)
|
this.spacingElement($$root)
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
if (document.readyState === 'complete') setTimeout(callback)
|
||||||
|
else document.addEventListener('DOMContentLoaded', callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue