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:
@@ -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");
|
||||
|
Reference in New Issue
Block a user