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:
OdysseasKr 2015-12-09 02:31:52 +02:00 committed by lilia
parent d914f4affe
commit 652d0963fc

View file

@ -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");