fix: default btn position

This commit is contained in:
Xmader 2021-05-21 16:50:04 -04:00
parent 4e92c06791
commit 8cc089357f
No known key found for this signature in database
GPG Key ID: A20B97FB9EB730E4
1 changed files with 2 additions and 2 deletions

View File

@ -141,8 +141,6 @@ export class BtnList {
newParent.append(...this.list.map(e => cloneBtn(e)))
shadow.append(newParent)
// default position
newParent.style.top = '0px'
try {
const anchorDiv = this.getBtnParent()
const pos = () => this._positionBtns(anchorDiv, newParent)
@ -156,6 +154,8 @@ export class BtnList {
scroll.addEventListener('scroll', pos, { passive: true })
} catch (err) {
console.error(err)
// default position
newParent.style.top = `${window.innerHeight - newParent.getBoundingClientRect().height}px`
}
return btnParent