import {provideKeyBindings} from './shortcuts';
-import {debounce} from '../services/util';
-import Clipboard from '../services/clipboard';
+import {debounce} from '../services/util.ts';
+import {Clipboard} from '../services/clipboard.ts';
/**
* Initiate the codemirror instance for the markdown editor.
const onScrollDebounced = debounce(editor.actions.syncDisplayPosition.bind(editor.actions), 100, false);
let syncActive = editor.settings.get('scrollSync');
- editor.settings.onChange('scrollSync', val => syncActive = val);
+ editor.settings.onChange('scrollSync', val => {
+ syncActive = val;
+ });
const domEventHandlers = {
// Handle scroll to sync display view
editor.actions.insertClipboardImages(clipboardImages, event.pageX, event.pageY);
}
},
+ // Handle dragover event to allow as drop-target in chrome
+ dragover: event => {
+ event.preventDefault();
+ },
// Handle image paste
paste: event => {
const clipboard = new Clipboard(event.clipboardData || event.dataTransfer);