Update wiki.readFiles() to call the callback just once

Now we accumulate the results and just pass them to the callback once.
This commit is contained in:
Jermolene
2013-12-23 08:55:11 +00:00
parent 10c25c1692
commit 12b4cc5d3e
2 changed files with 14 additions and 12 deletions

View File

@@ -90,8 +90,8 @@ DropZoneWidget.prototype.handleDropEvent = function(event) {
// Try to import the various data types we understand
this.importData(dataTransfer);
// Import any files in the drop
this.wiki.readFiles(dataTransfer.files,function(tiddlerFields) {
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify([tiddlerFields])});
this.wiki.readFiles(dataTransfer.files,function(tiddlerFieldsArray) {
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify(tiddlerFieldsArray)});
});
// Tell the browser that we handled the drop
event.preventDefault();