1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-25 12:47:40 +00:00

Partially fix drag and drop on IE11

These changes allow drag and drop to work with one issue: <a> links are
not draggable; draggable divs, spans, buttons etc. seem to work fine.
There’s some issue with IE11 that I don’t understand.

For testing, you can force links to become spans by changing line 64 of
$:/core/modules/widgets/link.js to:

	var domNode = this.document.createElement("span");
This commit is contained in:
Jermolene
2017-03-27 09:59:40 +01:00
parent 0276b69244
commit d3fe4f600a
2 changed files with 11 additions and 11 deletions

View File

@@ -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) {