fix history for collab demo
This commit is contained in:
@@ -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,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -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),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user