diff --git a/core/modules/utils/dom/dragndrop.js b/core/modules/utils/dom/dragndrop.js index 385de4b25..6754900fd 100644 --- a/core/modules/utils/dom/dragndrop.js +++ b/core/modules/utils/dom/dragndrop.js @@ -90,8 +90,6 @@ exports.makeDraggable = function(options) { dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData)); dataTransfer.setData("Text",titleString); event.stopPropagation(); - } else { - event.preventDefault(); } return false; }}, @@ -141,7 +139,7 @@ var importDataTypes = [ if(match) { return parseJSONTiddlers(match[1],fallbackTitle); } else { - return [{text: data}]; // As URL string + return [{title: fallbackTitle, text: data}]; // As URL string } }}, {type: "text/x-moz-url", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) { @@ -150,20 +148,20 @@ var importDataTypes = [ if(match) { return parseJSONTiddlers(match[1],fallbackTitle); } else { - return [{text: data}]; // As URL string + return [{title: fallbackTitle, text: data}]; // As URL string } }}, {type: "text/html", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) { - return [{text: data}]; + return [{title: fallbackTitle, text: data}]; }}, {type: "text/plain", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) { - return [{text: data}]; + return [{title: fallbackTitle, text: data}]; }}, {type: "Text", IECompatible: true, toTiddlerFieldsArray: function(data,fallbackTitle) { - return [{text: data}]; + return [{title: fallbackTitle, text: data}]; }}, {type: "text/uri-list", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) { - return [{text: data}]; + return [{title: fallbackTitle, text: data}]; }} ]; diff --git a/core/modules/widgets/droppable.js b/core/modules/widgets/droppable.js index 1dacac5f2..5bddb6854 100644 --- a/core/modules/widgets/droppable.js +++ b/core/modules/widgets/droppable.js @@ -77,6 +77,7 @@ DroppableWidget.prototype.handleDragEnterEvent = function(event) { event.preventDefault(); // Tell the browser not to ripple the drag up to any parent drop handlers event.stopPropagation(); + return false; }; DroppableWidget.prototype.handleDragOverEvent = function(event) { @@ -87,10 +88,12 @@ DroppableWidget.prototype.handleDragOverEvent = function(event) { // Tell the browser that we're still interested in the drop event.preventDefault(); event.dataTransfer.dropEffect = "copy"; // Explicitly show this is a copy + return false; }; DroppableWidget.prototype.handleDragLeaveEvent = function(event) { this.leaveDrag(event); + return false; }; DroppableWidget.prototype.handleDropEvent = function(event) { @@ -106,15 +109,14 @@ DroppableWidget.prototype.handleDropEvent = function(event) { // Try to import the various data types we understand $tw.utils.importDataTransfer(dataTransfer,null,function(fieldsArray) { fieldsArray.forEach(function(fields) { - if(fields.title) { - self.performActions(fields.title,event); - } + self.performActions(fields.title || fields.text,event); }); }); // Tell the browser that we handled the drop event.preventDefault(); // Stop the drop ripple up to any parent handlers event.stopPropagation(); + return false; }; DroppableWidget.prototype.performActions = function(title,event) {