fix js error

This commit is contained in:
fantasticit 2023-01-03 22:02:02 +08:00
parent 0fbdd1d11c
commit 107b8b759c
1 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,8 @@ export const Dragable = Extension.create({
name: 'dragable',
addProseMirrorPlugins() {
if (!this.editor.isEditable) return [];
let editorView: EditorView;
let dragHandleDOM: HTMLElement;
let activeNode: ActiveNode;
@ -25,13 +27,13 @@ export const Dragable = Extension.create({
};
const showDragHandleDOM = () => {
dragHandleDOM.classList.add('show');
dragHandleDOM.classList.remove('hide');
dragHandleDOM?.classList?.add('show');
dragHandleDOM?.classList?.remove('hide');
};
const hideDragHandleDOM = () => {
dragHandleDOM.classList.remove('show');
dragHandleDOM.classList.add('hide');
dragHandleDOM?.classList?.remove('show');
dragHandleDOM?.classList?.add('hide');
};
const renderDragHandleDOM = (view: EditorView, el: HTMLElement) => {