CKeditor撤消重做事件

CKeditor撤消重做事件,ckeditor,Ckeditor,在执行撤消和重做操作之前是否需要Ck编辑器事件?我在重做后和撤消后尝试了撤消管理器事件,但它在执行操作后提供事件,我需要它。您可以使用beforeCommandExec事件并检查撤消和重做事件。类似这样的东西,其中editorInstance是和CKEDITOR实例 editorInstance.on('beforeCommandExec', function(e){ if(e.data.name === 'undo') { // handle before undo

在执行撤消和重做操作之前是否需要Ck编辑器事件?我在重做后和撤消后尝试了撤消管理器事件,但它在执行操作后提供事件,我需要它。

您可以使用beforeCommandExec事件并检查撤消和重做事件。类似这样的东西,其中editorInstance是和CKEDITOR实例

editorInstance.on('beforeCommandExec', function(e){
    if(e.data.name === 'undo') {
        // handle before undo
    }
    if(e.data.name === 'redo') {
        // handle before redo 
    }
});