Improve status div positioning
This commit is contained in:
parent
953d0ef548
commit
e8b1ab94d9
11
service2.js
11
service2.js
@ -308,10 +308,13 @@ class BesService {
|
||||
*/
|
||||
setStatusDivPosition() {
|
||||
const rect = this.hostElement.getBoundingClientRect()
|
||||
const scrollLeft = window.scrollX || document.documentElement.scrollLeft
|
||||
const scrollTop = window.scrollY || document.documentElement.scrollTop
|
||||
this.statusDiv.style.left = `${rect.right - 40 + scrollLeft}px`
|
||||
this.statusDiv.style.top = `${rect.bottom - 30 + scrollTop}px`
|
||||
const parentRect = this.hostElement.parentElement.getBoundingClientRect()
|
||||
const scrollbarWidth =
|
||||
this.hostElement.offsetWidth - this.hostElement.clientWidth
|
||||
this.statusDiv.style.left = `${
|
||||
rect.right - parentRect.left - 40 - scrollbarWidth
|
||||
}px`
|
||||
this.statusDiv.style.top = `${rect.bottom - parentRect.top - 30}px`
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user