mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-01-03 23:42:28 +03:00
Lexical: Added context toolbar placement, added link toolbar
Also added some basic context toolbar styling
This commit is contained in:
@@ -16,8 +16,14 @@ export class EditorContextToolbar extends EditorContainerUiElement {
|
||||
}
|
||||
|
||||
attachTo(target: HTMLElement) {
|
||||
// Todo - attach to target position
|
||||
console.log('attaching context toolbar to', target);
|
||||
const targetBounds = target.getBoundingClientRect();
|
||||
const dom = this.getDOMElement();
|
||||
const domBounds = dom.getBoundingClientRect();
|
||||
|
||||
const targetMid = targetBounds.left + (targetBounds.width / 2);
|
||||
const targetLeft = targetMid - (domBounds.width / 2);
|
||||
dom.style.top = (targetBounds.bottom + 6) + 'px';
|
||||
dom.style.left = targetLeft + 'px';
|
||||
}
|
||||
|
||||
insert(children: EditorUiElement[]) {
|
||||
|
||||
Reference in New Issue
Block a user