mirror of https://github.com/fantasticit/think.git
tiptap: fix copy node
This commit is contained in:
parent
8e728391f2
commit
86fc6bf843
|
@ -56,7 +56,7 @@ export const Clipboard = Extension.create<IClipboardOptions>({
|
||||||
|
|
||||||
if (currentNode) {
|
if (currentNode) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
copyNode(currentNode);
|
copyNode(currentNode, extensionThis.editor);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,9 @@ import { Fragment, Node } from 'prosemirror-model';
|
||||||
|
|
||||||
import { debug } from './debug';
|
import { debug } from './debug';
|
||||||
|
|
||||||
export function copyNode(nodeOrNodeName: Node | Fragment<any>);
|
export function copyNode(nodeOrNodeName: Node | Fragment<any>, editor: Editor);
|
||||||
export function copyNode(nodeOrNodeName: string, editor: Editor);
|
export function copyNode(nodeOrNodeName: string, editor: Editor);
|
||||||
export function copyNode(nodeOrNodeName: string | Node | Fragment<any>, editor?: Editor) {
|
export function copyNode(nodeOrNodeName: string | Node | Fragment<any>, editor: Editor) {
|
||||||
let targetNode = null;
|
let targetNode = null;
|
||||||
|
|
||||||
if (typeof nodeOrNodeName === 'string') {
|
if (typeof nodeOrNodeName === 'string') {
|
||||||
|
|
Loading…
Reference in New Issue