minor improvement

This commit is contained in:
Hauke Klement
2015-03-14 12:50:45 +01:00
parent 79d82dd9f3
commit 814f0c9844

View File

@ -27,8 +27,10 @@ $(function() {
};
var ajaxError = function(response) {
var message = ((response || {}).responseJSON || {}).message || '';
$.flash.danger({
text: (response && response.responseJSON && response.responseJSON.message) || $('#flash').data('message-failure')
text: message.length > 0 ? message : $('#flash').data('message-failure')
});
};