fix: Adjust popup positioning #34
This commit is contained in:
parent
18d23633ff
commit
675ecdc7a4
@ -2085,7 +2085,7 @@ class BesPopup extends HTMLElement {
|
|||||||
if (x + this.offsetWidth <= window.innerWidth) {
|
if (x + this.offsetWidth <= window.innerWidth) {
|
||||||
this.style.left = `${x}px`
|
this.style.left = `${x}px`
|
||||||
} else if (this.offsetWidth <= x) {
|
} else if (this.offsetWidth <= x) {
|
||||||
this.style.left = `${x - this.offsetWidth}px`
|
this.style.left = `${x - this.offsetWidth - 10}px`
|
||||||
} else {
|
} else {
|
||||||
this.style.left = `${(window.innerWidth - this.offsetWidth) / 2}px`
|
this.style.left = `${(window.innerWidth - this.offsetWidth) / 2}px`
|
||||||
}
|
}
|
||||||
@ -2093,7 +2093,7 @@ class BesPopup extends HTMLElement {
|
|||||||
if (y + 20 + this.offsetHeight <= window.innerHeight) {
|
if (y + 20 + this.offsetHeight <= window.innerHeight) {
|
||||||
this.style.top = `${y + 20}px`
|
this.style.top = `${y + 20}px`
|
||||||
} else if (this.offsetHeight <= y) {
|
} else if (this.offsetHeight <= y) {
|
||||||
this.style.top = `${y - this.offsetHeight}px`
|
this.style.top = `${y - this.offsetHeight - 20}px`
|
||||||
} else {
|
} else {
|
||||||
this.style.top = `${(window.innerHeight - this.offsetHeight) / 2}px`
|
this.style.top = `${(window.innerHeight - this.offsetHeight) / 2}px`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user