1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Restored drag and drop functionality within TEXTAREAs and INPUTs

As mentioned by @Skeeve in #592
This commit is contained in:
Jermolene 2014-05-07 14:32:14 +01:00
parent 8b20143b1b
commit e548dd35af

View File

@ -66,6 +66,10 @@ DropZoneWidget.prototype.handleDragEnterEvent = function(event) {
};
DropZoneWidget.prototype.handleDragOverEvent = function(event) {
// Check for being over a TEXTAREA or INPUT
if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) !== -1) {
return false;
}
// Tell the browser that we're still interested in the drop
event.preventDefault();
event.dataTransfer.dropEffect = "copy"; // Explicitly show this is a copy
@ -81,6 +85,10 @@ DropZoneWidget.prototype.handleDragLeaveEvent = function(event) {
};
DropZoneWidget.prototype.handleDropEvent = function(event) {
// Check for being over a TEXTAREA or INPUT
if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) !== -1) {
return false;
}
var self = this,
dataTransfer = event.dataTransfer;
// Reset the enter count