@seafile/seafile-editor 0.3.85 → 0.3.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
File without changes
|
|
@@ -233,10 +233,18 @@ var Plugin = function Plugin(_editor) {
|
|
|
233
233
|
|
|
234
234
|
if (nodeList.length === 1) {
|
|
235
235
|
event.preventDefault();
|
|
236
|
-
|
|
236
|
+
|
|
237
|
+
var _nodeList$ = _slicedToArray(nodeList[0], 2),
|
|
238
|
+
node = _nodeList$[0],
|
|
239
|
+
path = _nodeList$[1];
|
|
240
|
+
|
|
241
|
+
path = path.slice(1);
|
|
237
242
|
|
|
238
243
|
if (node && node.type === 'paragraph') {
|
|
239
|
-
|
|
244
|
+
// get selected paragraph node in selection and write to clipboard
|
|
245
|
+
var fragment = Node.fragment(editor, editor.selection);
|
|
246
|
+
var selectedNode = Node.get(fragment[0], Array(path.length).fill(0));
|
|
247
|
+
setEventTransfer(event, 'fragment', [selectedNode]);
|
|
240
248
|
} else {
|
|
241
249
|
setEventTransfer(event, 'text', SfEditor.text(editor, editor.selection));
|
|
242
250
|
}
|