diff options
author | Max <max@nextcloud.com> | 2022-02-07 13:08:59 +0300 |
---|---|---|
committer | Max <max@nextcloud.com> | 2022-02-09 11:42:47 +0300 |
commit | c1af1a31584ffe9dac327c1e6eff037c77fa267c (patch) | |
tree | 559dbbed15abe2717bb2aaee9b0114c67a31218a /src/nodes | |
parent | 8f64aaa06475726456ee5099a86effd03873b1eb (diff) |
fix: use tiptap v2 prop deleteNode to delete image
Signed-off-by: Max <max@nextcloud.com>
Diffstat (limited to 'src/nodes')
-rw-r--r-- | src/nodes/ImageView.vue | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/nodes/ImageView.vue b/src/nodes/ImageView.vue index 5d3887029..8b480f2ff 100644 --- a/src/nodes/ImageView.vue +++ b/src/nodes/ImageView.vue @@ -45,7 +45,7 @@ v-if="showIcons" class="trash-icon" title="Delete this image" - @click="deleteImage"> + @click="deleteNode"> <TrashCanIcon /> </div> </div> @@ -122,7 +122,7 @@ export default { mixins: [ store, ], - props: ['editor', 'node', 'extension', 'updateAttributes', 'getPos'], // eslint-disable-line + props: ['editor', 'node', 'extension', 'updateAttributes', 'deleteNode'], // eslint-disable-line data() { return { imageLoaded: false, @@ -296,12 +296,6 @@ export default { this.editor.commands.scrollIntoView() }) }, - deleteImage() { - const tr = this.view.state.tr - const pos = this.getPos() - tr.delete(pos, pos + this.node.nodeSize) - this.view.dispatch(tr) - }, }, } </script> |