Skip to content

Commit

Permalink
Merge pull request #535 from humphd/issue530
Browse files Browse the repository at this point in the history
Fix #530 - Figure out why DnD using the Upload Files dialog is broken
  • Loading branch information
gideonthomas committed Mar 1, 2016
2 parents c63b352 + 69c5c7a commit 1117120
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/utils/DragAndDrop.js
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ define(function (require, exports, module) {
return false;
}

function _showErrorDialog(errorFiles) {
function _showErrorDialog(errorFiles, callback) {
function errorToString(err) {
return FileUtils.getFileErrorString(err);
}
@@ -90,11 +90,15 @@ define(function (require, exports, module) {
});
message += "</ul>";

Dialogs.showModalDialog(
var dlg = Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_ERROR,
Strings.ERROR_OPENING_FILE_TITLE,
message
);

if(callback) {
dlg.done(callback);
}
}

/**
@@ -386,10 +390,8 @@ define(function (require, exports, module) {
// Check whether we want to import this file at all before we start.
var wasRejected = rejectImport(item);
if (wasRejected) {
setTimeout(function(){
errorList.push({path: item.name, error: wasRejected.message});
deferred.reject(wasRejected);
}, 5);
errorList.push({path: item.name, error: wasRejected.message});
deferred.reject(wasRejected);
return deferred.promise();
}

@@ -438,8 +440,9 @@ define(function (require, exports, module) {
callback(null, pathList);
})
.fail(function() {
_showErrorDialog(errorList);
callback(errorList);
_showErrorDialog(errorList, function() {
callback(errorList);
});
});
}

0 comments on commit 1117120

Please sign in to comment.