Add drag and drop support for text
By adding the drag and drop support for media files, the default event handlers were overwritten. Thus drag and drop did not support text. Now, the drag and drop listeners revert to the default behaviour when the user does not drag a file. Resolves: #478
This commit is contained in:
parent
d914f4affe
commit
652d0963fc
1 changed files with 6 additions and 0 deletions
|
@ -234,6 +234,8 @@
|
|||
},
|
||||
|
||||
openDropped: function(e) {
|
||||
if (e.originalEvent.dataTransfer.types[0] != "Files") return;
|
||||
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
this.file = e.originalEvent.dataTransfer.files[0];
|
||||
|
@ -242,12 +244,16 @@
|
|||
},
|
||||
|
||||
showArea: function(e) {
|
||||
if (e.originalEvent.dataTransfer.types[0] != "Files") return;
|
||||
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
this.$el.addClass("dropoff");
|
||||
},
|
||||
|
||||
hideArea: function(e) {
|
||||
if (e.originalEvent.dataTransfer.types[0] != "Files") return;
|
||||
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
this.$el.removeClass("dropoff");
|
||||
|
|
Loading…
Reference in a new issue