Skip to content

Commit

Permalink
Remove wrong dragstart and dragend events
Browse files Browse the repository at this point in the history
The dragstart and dragend events will only be used when the element (the picture input) is draged, which isn't that what you want
  • Loading branch information
BennyAlex authored May 7, 2018
1 parent 6590d56 commit 271a615
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions PictureInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
:class="computedClasses"
@drag.stop.prevent=""
@dragover.stop.prevent=""
@dragstart.stop.prevent="onDragStart"
@dragenter.stop.prevent="onDragStart"
@dragend.stop.prevent="onDragStop"
@dragleave.stop.prevent="onDragStop"
@dragstart.stop.prevent=""
@dragend.stop.prevent=""
@dragenter.stop.prevent="onDragEnter"
@dragleave.stop.prevent="onDragLeave"
@drop.stop.prevent="onFileDrop"
@click.prevent="onClick"
:style="{height: previewHeight + 'px', zIndex: zIndex + 1 }">
Expand Down Expand Up @@ -231,20 +231,20 @@ export default {
this.drawImage(this.imageObject)
}
},
onDragStart () {
onDragEnter () {
if (!this.supportsDragAndDrop) {
return
}
this.draggingOver = true
},
onDragStop () {
onDragLeave () {
if (!this.supportsDragAndDrop) {
return
}
this.draggingOver = false
},
onFileDrop (e) {
this.onDragStop()
this.onDragLeave()
this.onFileChange(e)
},
onFileChange (e, prefill) {
Expand Down

0 comments on commit 271a615

Please sign in to comment.