mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-09 10:22:51 +03:00
MD Editor: Worked to improve/fix positioning code
Still pending testing. Old logic did not work when lines would wrap, so changing things to a character/line measuring technique. Fixed some other isues too while testing shortcuts.
This commit is contained in:
@@ -25,7 +25,7 @@ export function getMarkdownDomEventHandlers(editor: MarkdownEditor): MarkdownEdi
|
||||
const templateId = event.dataTransfer.getData('bookstack/template');
|
||||
if (templateId) {
|
||||
event.preventDefault();
|
||||
editor.actions.insertTemplate(templateId, event.pageX, event.pageY);
|
||||
editor.actions.insertTemplate(templateId, event);
|
||||
}
|
||||
|
||||
const clipboard = new Clipboard(event.dataTransfer);
|
||||
@@ -33,7 +33,7 @@ export function getMarkdownDomEventHandlers(editor: MarkdownEditor): MarkdownEdi
|
||||
if (clipboardImages.length > 0) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
editor.actions.insertClipboardImages(clipboardImages, event.pageX, event.pageY);
|
||||
editor.actions.insertClipboardImages(clipboardImages, event);
|
||||
}
|
||||
},
|
||||
// Handle dragover event to allow as drop-target in chrome
|
||||
|
Reference in New Issue
Block a user