Canvas V2
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
// MarkdownEditor.create(mount, opts) → { view, actions, getValue, focus, destroy }
|
||||
// opts.doc initial text
|
||||
// opts.keymap extra CM key bindings, ahead of the defaults
|
||||
// opts.onChange called after every change to the text
|
||||
// MarkdownEditor.bind(root, getActions)
|
||||
// wires root's [data-action] buttons, [data-key] shortcuts and toolbar
|
||||
// dropdowns to whatever getActions() returns (null = no editor open).
|
||||
@@ -89,6 +90,9 @@ window.MarkdownEditor = (function () {
|
||||
CM.closeBrackets(),
|
||||
CM.autocompletion({ override: [WikiComplete.source] }),
|
||||
CM.theme,
|
||||
opts.onChange ? CM.EditorView.updateListener.of(function (u) {
|
||||
if (u.docChanged) opts.onChange();
|
||||
}) : [],
|
||||
CM.Prec.highest(CM.keymap.of(tableKeymap)),
|
||||
CM.keymap.of([].concat(
|
||||
CM.closeBracketsKeymap,
|
||||
|
||||
Reference in New Issue
Block a user