mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-14 15:56:38 +08:00
Connected md editor settings to logic for functionality
This commit is contained in:
@ -24,7 +24,13 @@ export async function init(editor) {
|
||||
|
||||
// Handle scroll to sync display view
|
||||
const onScrollDebounced = debounce(editor.actions.syncDisplayPosition.bind(editor.actions), 100, false);
|
||||
cm.on('scroll', instance => onScrollDebounced(instance));
|
||||
let syncActive = editor.settings.get('scrollSync');
|
||||
editor.settings.onChange('scrollSync', val => syncActive = val);
|
||||
cm.on('scroll', instance => {
|
||||
if (syncActive) {
|
||||
onScrollDebounced(instance);
|
||||
}
|
||||
});
|
||||
|
||||
// Handle image paste
|
||||
cm.on('paste', (cm, event) => {
|
||||
|
Reference in New Issue
Block a user