Skip to content

Commit

Permalink
Merge pull request #242 from RitvikSardana/empty-video-image
Browse files Browse the repository at this point in the history
fix: video and image controls should not have empty url
  • Loading branch information
RitvikSardana authored Jan 16, 2025
2 parents b060fc2 + 8103d33 commit edbb4bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/TextEditor/InsertImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
/>
</template>
<template #actions>
<Button variant="solid" @click="addImage(addImageDialog.url)">
Insert Image
</Button>
<Button @click="reset"> Cancel </Button>
<div class="flex gap-2">
<Button variant="solid" @click="addImage(addImageDialog.url)">
Insert Image
</Button>
<Button @click="reset"> Cancel </Button>
</div>
</template>
</Dialog>
</template>
Expand Down Expand Up @@ -63,6 +65,7 @@ export default {
})
},
addImage(src) {
if (!src) return
this.editor.chain().focus().setImage({ src }).run()
this.reset()
},
Expand Down
1 change: 1 addition & 0 deletions src/components/TextEditor/InsertVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default {
},
addVideo(src) {
if (!src) return
this.editor
.chain()
.focus()
Expand Down

0 comments on commit edbb4bd

Please sign in to comment.