Better handling for chapter upload error

This commit is contained in:
David Baumgold
2013-05-30 13:54:00 -04:00
parent b43f1c7331
commit 2832233eb9

View File

@@ -176,6 +176,9 @@ CMS.Views.UploadDialog = Backbone.View.extend({
success: _.bind(this.success, this),
error: _.bind(this.error, this),
uploadProgress: _.bind(this.progress, this),
data: {
notifyOnError: false
}
});
},
progress: function(event, position, total, percentComplete) {
@@ -198,7 +201,11 @@ CMS.Views.UploadDialog = Backbone.View.extend({
this.remove();
},
error: function() {
this.model.set("uploading", false);
this.model.set({
"uploading": false,
"uploadedBytes": 0,
"title": gettext("We're sorry, there was an error"),
});
}
})
var section = new CMS.Models.Section({