fix history for collab demo

This commit is contained in:
Philipp Kühn
2020-12-01 14:55:11 +01:00
parent d8322d2e2e
commit 5ae9d8cca4
3 changed files with 6 additions and 4 deletions

View File

@@ -82,7 +82,7 @@ export default {
this.editor = new Editor({ this.editor = new Editor({
extensions: [ extensions: [
...defaultExtensions(), ...defaultExtensions().filter(extension => extension.config.name !== 'history'),
Collaboration.configure({ Collaboration.configure({
provider, provider,
}), }),

View File

@@ -26,9 +26,9 @@ const Collaboration = Extension.create({
addKeyboardShortcuts() { addKeyboardShortcuts() {
return { return {
'Mod-z': undo, 'Mod-z': () => undo(this.editor.state),
'Mod-y': redo, 'Mod-y': () => redo(this.editor.state),
'Mod-Shift-z': redo, 'Mod-Shift-z': () => redo(this.editor.state),
} }
}, },

View File

@@ -7,6 +7,8 @@ export interface HistoryOptions {
} }
const History = Extension.create({ const History = Extension.create({
name: 'history',
defaultOptions: <HistoryOptions>{ defaultOptions: <HistoryOptions>{
depth: 100, depth: 100,
newGroupDelay: 500, newGroupDelay: 500,