mirror of https://github.com/fantasticit/think.git
Merge pull request #151 from fantasticit/fix/drag
This commit is contained in:
commit
3c11bfc121
|
@ -147,17 +147,19 @@ export const Dragable = Extension.create({
|
|||
const result = selectRootNodeByDom(dom, view);
|
||||
activeNode = result;
|
||||
|
||||
if (!result) {
|
||||
if (
|
||||
!result ||
|
||||
result.node.type.name === 'title' ||
|
||||
result.node.type.name === 'tableOfContents' ||
|
||||
// empty paragraph
|
||||
(result.node.type.name === 'paragraph' && result.node.nodeSize === 2)
|
||||
) {
|
||||
if (dragging) return false;
|
||||
hideDragHandleDOM();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result.node.type.name === 'title') {
|
||||
if (dragging) return false;
|
||||
hideDragHandleDOM();
|
||||
return false;
|
||||
}
|
||||
console.log(result);
|
||||
|
||||
renderDragHandleDOM(view, result.el);
|
||||
return false;
|
||||
|
|
|
@ -2,6 +2,5 @@ import { mergeAttributes } from '@tiptap/core';
|
|||
import TitapParagraph from '@tiptap/extension-paragraph';
|
||||
|
||||
export const Paragraph = TitapParagraph.extend({
|
||||
draggable: true,
|
||||
selectable: true,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue