]> BookStack Code Mirror - bookstack/blobdiff - resources/js/markdown/inputs/codemirror.ts
Deps: Updated PHP composer dependancy versions, fixed test namespaces
[bookstack] / resources / js / markdown / inputs / codemirror.ts
index 3ab219a6330e9cd6ee07c32b559b9940d122243a..827068238e0e70c400525a55a484966a05a95cb5 100644 (file)
@@ -72,8 +72,8 @@ export class CodemirrorInput implements MarkdownEditorInput {
         return this.cm.state.doc.lineAt(index).text;
     }
 
-    coordsToSelection(x: number, y: number): MarkdownEditorInputSelection {
-        const cursorPos = this.cm.posAtCoords({x, y}, false);
+    eventToPosition(event: MouseEvent): MarkdownEditorInputSelection {
+        const cursorPos = this.cm.posAtCoords({x: event.screenX, y: event.screenY}, false);
         return {from: cursorPos, to: cursorPos};
     }