|
124 | 124 | }, |
125 | 125 | { |
126 | 126 | label: this.$tr('makeACopy'), |
127 | | - onClick: this.duplicateNode, |
| 127 | + onClick: () => this.duplicateNode(this.nodeId), |
128 | 128 | condition: this.canEdit, |
129 | 129 | }, |
130 | 130 | { |
|
282 | 282 | }); |
283 | 283 | }, |
284 | 284 | moveNode(target) { |
285 | | - return this.moveContentNodes({ id__in: [this.nodeId], parent: target }).then( |
286 | | - this.$refs.moveModal.moveComplete |
287 | | - ); |
| 285 | + return this.moveContentNodes({ |
| 286 | + id__in: [this.nodeId], |
| 287 | + parent: target, |
| 288 | + inherit: this.node.parent !== target, |
| 289 | + }).then(this.$refs.moveModal.moveComplete); |
288 | 290 | }, |
289 | 291 | getRemoveNodeRedirect() { |
290 | 292 | // Returns a callback to do appropriate post-removal navigation |
|
322 | 324 | removeNode: withChangeTracker(function(id__in, changeTracker) { |
323 | 325 | this.trackAction('Delete'); |
324 | 326 | const redirect = this.getRemoveNodeRedirect(); |
325 | | - return this.moveContentNodes({ id__in, parent: this.trashId }).then(() => { |
| 327 | + return this.moveContentNodes({ id__in, parent: this.trashId, inherit: false }).then(() => { |
326 | 328 | redirect(); |
327 | 329 | this.showSnackbar({ |
328 | 330 | text: this.$tr('removedItems'), |
|
345 | 347 | } |
346 | 348 | ); |
347 | 349 | }), |
348 | | - duplicateNode: withChangeTracker(async function(changeTracker) { |
| 350 | + duplicateNode: withChangeTracker(async function(nodeId, changeTracker) { |
349 | 351 | this.trackAction('Copy'); |
350 | 352 | this.showSnackbar({ |
351 | 353 | duration: null, |
|
356 | 358 | // actionCallback: () => changeTracker.revert(), |
357 | 359 | }); |
358 | 360 | const copiedContentNode = await this.copyContentNode({ |
359 | | - id: this.nodeId, |
360 | | - target: this.nodeId, |
| 361 | + id: nodeId, |
| 362 | + target: nodeId, |
361 | 363 | position: RELATIVE_TREE_POSITIONS.RIGHT, |
362 | 364 | }); |
363 | 365 |
|
|
0 commit comments