mirror of https://github.com/fantasticit/think.git
fix js error
This commit is contained in:
parent
0fbdd1d11c
commit
107b8b759c
|
@ -10,6 +10,8 @@ export const Dragable = Extension.create({
|
||||||
name: 'dragable',
|
name: 'dragable',
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
|
if (!this.editor.isEditable) return [];
|
||||||
|
|
||||||
let editorView: EditorView;
|
let editorView: EditorView;
|
||||||
let dragHandleDOM: HTMLElement;
|
let dragHandleDOM: HTMLElement;
|
||||||
let activeNode: ActiveNode;
|
let activeNode: ActiveNode;
|
||||||
|
@ -25,13 +27,13 @@ export const Dragable = Extension.create({
|
||||||
};
|
};
|
||||||
|
|
||||||
const showDragHandleDOM = () => {
|
const showDragHandleDOM = () => {
|
||||||
dragHandleDOM.classList.add('show');
|
dragHandleDOM?.classList?.add('show');
|
||||||
dragHandleDOM.classList.remove('hide');
|
dragHandleDOM?.classList?.remove('hide');
|
||||||
};
|
};
|
||||||
|
|
||||||
const hideDragHandleDOM = () => {
|
const hideDragHandleDOM = () => {
|
||||||
dragHandleDOM.classList.remove('show');
|
dragHandleDOM?.classList?.remove('show');
|
||||||
dragHandleDOM.classList.add('hide');
|
dragHandleDOM?.classList?.add('hide');
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderDragHandleDOM = (view: EditorView, el: HTMLElement) => {
|
const renderDragHandleDOM = (view: EditorView, el: HTMLElement) => {
|
||||||
|
|
Loading…
Reference in New Issue