BUGFIX: cancelling an upload should hide cancel button

This commit is contained in:
Régis Hanol 2014-07-21 11:14:01 +02:00
parent 499f18a099
commit 9c2a7f0fd1

View file

@ -290,7 +290,8 @@ var ComposerView = Discourse.View.extend(Ember.Evented, {
// bind on the click event on the cancel link
$('#cancel-file-upload').on('click', function() {
// cancel the upload
// NOTE: this will trigger a 'fileuploadfail' event with status = 0
self.set('isUploading', false);
// NOTE: this might trigger a 'fileuploadfail' event with status = 0
if (jqXHR) jqXHR.abort();
// unbind
$(this).off('click');