mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Revised fix for IE drag/drop issue #252
Also improve browser drag/drop inter-op a tiny bit
This commit is contained in:
parent
80e0714c0d
commit
0984e9322f
@ -117,6 +117,9 @@ DropZoneWidget.prototype.importData = function(dataTransfer) {
|
||||
};
|
||||
|
||||
DropZoneWidget.prototype.importDataTypes = [
|
||||
{type: "text/vnd.tiddler", convertToFields: function(data) {
|
||||
return JSON.parse(data);
|
||||
}},
|
||||
{type: "URL", convertToFields: function(data) {
|
||||
// check for tiddler data URI
|
||||
var match = decodeURI(data).match(/^data\:text\/vnd\.tiddler,(.*)/i);
|
||||
@ -128,15 +131,12 @@ DropZoneWidget.prototype.importDataTypes = [
|
||||
};
|
||||
}
|
||||
}},
|
||||
{type: "Text", convertToFields: function(data) {
|
||||
{type: "text/plain", convertToFields: function(data) {
|
||||
return {
|
||||
text: data
|
||||
};
|
||||
}},
|
||||
{type: "text/vnd.tiddler", convertToFields: function(data) {
|
||||
return JSON.parse(data);
|
||||
}},
|
||||
{type: "text/plain", convertToFields: function(data) {
|
||||
{type: "Text", convertToFields: function(data) {
|
||||
return {
|
||||
text: data
|
||||
};
|
||||
|
@ -129,8 +129,10 @@ LinkWidget.prototype.handleDragStartEvent = function(event) {
|
||||
dataTransfer.setDragImage(this.dragImage.firstChild,-16,-16);
|
||||
}
|
||||
dataTransfer.clearData();
|
||||
if(!(/msie|trident/i.test(navigator.userAgent))) {
|
||||
dataTransfer.setData("text/vnd.tiddler",this.wiki.getTiddlerAsJson(this.to));
|
||||
dataTransfer.setData("text/plain",this.wiki.getTiddlerText(this.to,""));
|
||||
}
|
||||
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURI(this.wiki.getTiddlerAsJson(this.to)));
|
||||
dataTransfer.setData("Text",this.wiki.getTiddlerText(this.to,""));
|
||||
event.stopPropagation();
|
||||
|
Loading…
Reference in New Issue
Block a user