Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #530 - Figure out why DnD using the Upload Files dialog is broken #535

Merged
merged 1 commit into from
Mar 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/utils/DragAndDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
}

/**
Expand Down Expand Up @@ -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();
}

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

Expand Down