Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chosenFile with initial image #207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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