1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Lexical: Further fixes

- Improved node resizer positioning to be more accurate
- Fixed drop handling not running within editor margin space
- Made media dom update smarter to reduce reloads
- Fixed media alignment, broken due to added wrapper
This commit is contained in:
Dan Brown
2024-09-09 12:28:01 +01:00
parent 16518a4f89
commit fd07aa0f05
7 changed files with 68 additions and 12 deletions

View File

@ -73,11 +73,15 @@ class NodeResizer {
return;
}
const nodeDOMBounds = nodeDOM.getBoundingClientRect();
this.dom.style.left = nodeDOM.offsetLeft + 'px';
this.dom.style.top = nodeDOM.offsetTop + 'px';
this.dom.style.width = nodeDOMBounds.width + 'px';
this.dom.style.height = nodeDOMBounds.height + 'px';
const scrollAreaRect = this.scrollContainer.getBoundingClientRect();
const nodeRect = nodeDOM.getBoundingClientRect();
const top = nodeRect.top - (scrollAreaRect.top - this.scrollContainer.scrollTop);
const left = nodeRect.left - scrollAreaRect.left;
this.dom.style.top = `${top}px`;
this.dom.style.left = `${left}px`;
this.dom.style.width = nodeRect.width + 'px';
this.dom.style.height = nodeRect.height + 'px';
}
protected updateDOMSize(width: number, height: number): void {