Skip to content

Commit

Permalink
Issue #994. Provide a better flash message for 413.
Browse files Browse the repository at this point in the history
Also, make sure z-index is higher than the image preview.
  • Loading branch information
Mike Taylor committed Apr 23, 2016
1 parent 68a0558 commit bb9e9f9
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
/* states */
.wc-FlashMessage.is-active {
display:block;
z-index: 2;
z-index: 10;
}

/* modifier */
10 changes: 7 additions & 3 deletions webcompat/static/js/lib/bugform.js
Original file line number Diff line number Diff line change
@@ -102,10 +102,14 @@ function BugForm() {
this.loaderImage.hide();
window.location.href = '/thanks/' + response.number;
}, this),
error: function() {
error: _.bind(function(response) {
var msg = 'There was an error trying to file the bug, try again?.';
wcEvents.trigger('flash:error', {message: msg, timeout: 4000});
}
if (response && response.status === 413) {
msg = 'The image is too big!\n Please choose something smaller than 4MB and try again.';
}
wcEvents.trigger('flash:error', {message: msg, timeout: 5000});
this.loaderImage.hide();
}, this)
});
};

0 comments on commit bb9e9f9

Please sign in to comment.