Find a way to correctly position statusDiv element inside CKEditor.

This commit is contained in:
Aljaž Grilc 2024-05-23 14:20:59 +02:00
parent 94f55e0d7f
commit 5871f38f26

View File

@ -911,14 +911,8 @@ class BesCKService extends BesTreeService {
* Repositions status DIV element.
*/
setStatusDivPosition() {
// TODO: The position returned by this.hostElement.getBoundingClientRect() appears to be absolute,
// while this.statusDiv.style.left and .top require relative position. Either compensate by subtracting
// CKEditor frame position, or change statusDiv placement to absolute.
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 - 50 + scrollLeft}px`
this.statusDiv.style.top = `${rect.bottom - 120 + scrollTop}px`
this.statusDiv.style.right = `10px`
this.statusDiv.style.bottom = `10px`
}
}