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
pull/749/head
OdysseasKr 9 years ago committed by lilia
parent d914f4affe
commit 652d0963fc

@ -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…
Cancel
Save