Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/cropper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,13 @@ export default {
this.$refs.fileInput.click()
},

remove () {
remove (keepChosenFile = false) {
if (!this.imageSet) return
this._setPlaceholders()

let hadImage = this.img != null
this.originalImage = null
this.img = null
this.$refs.fileInput.value = ''
this.imgData = {
width: 0,
height: 0,
Expand All @@ -495,7 +494,10 @@ export default {
this.scaleRatio = null
this.userMetadata = null
this.imageSet = false
this.chosenFile = null
if (!keepChosenFile) {
this.$refs.fileInput.value = ''
this.chosenFile = null
}
if (this.video) {
this.video.pause()
this.video = null
Expand Down Expand Up @@ -677,7 +679,7 @@ export default {

_onload (img, orientation = 1, initial) {
if (this.imageSet) {
this.remove()
this.remove(true)
}
this.originalImage = img
this.img = img
Expand Down