mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-08 23:20:03 +00:00
Fixed problem with multiple tiddlers created from dragging a single file
This commit is contained in:
parent
644d88a6c5
commit
f4b27b33de
@ -87,12 +87,14 @@ DropZoneWidget.prototype.handleDropEvent = function(event) {
|
|||||||
this.dragEnterCount = 0;
|
this.dragEnterCount = 0;
|
||||||
// Remove highlighting
|
// Remove highlighting
|
||||||
$tw.utils.removeClass(this.domNodes[0],"tw-dragover");
|
$tw.utils.removeClass(this.domNodes[0],"tw-dragover");
|
||||||
// Try to import the various data types we understand
|
|
||||||
this.importData(dataTransfer);
|
|
||||||
// Import any files in the drop
|
// Import any files in the drop
|
||||||
this.wiki.readFiles(dataTransfer.files,function(tiddlerFieldsArray) {
|
var numFiles = this.wiki.readFiles(dataTransfer.files,function(tiddlerFieldsArray) {
|
||||||
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify(tiddlerFieldsArray)});
|
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify(tiddlerFieldsArray)});
|
||||||
});
|
});
|
||||||
|
// Try to import the various data types we understand
|
||||||
|
if(numFiles === 0) {
|
||||||
|
this.importData(dataTransfer);
|
||||||
|
}
|
||||||
// Tell the browser that we handled the drop
|
// Tell the browser that we handled the drop
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// Stop the drop ripple up to any parent handlers
|
// Stop the drop ripple up to any parent handlers
|
||||||
|
@ -1045,6 +1045,7 @@ exports.readFiles = function(files,callback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
return files.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user