Commit 22701ee0 authored by Ad Schellevis's avatar Ad Schellevis

(mvc) propagate ajax errors

parent d988799a
...@@ -53,6 +53,22 @@ ...@@ -53,6 +53,22 @@
xhr.setRequestHeader("X-CSRFTokenKey", "{{ csrf_tokenKey }}" ); xhr.setRequestHeader("X-CSRFTokenKey", "{{ csrf_tokenKey }}" );
} }
}); });
// propagate ajax error messages
$( document ).ajaxError(function( event, request ) {
if (request.responseJSON.errorMessage != undefined) {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_DANGER,
title: '{{ lang._('Error') }}',
message:request.responseJSON.errorMessage,
buttons: [{
label: '{{ lang._('Close') }}',
action: function(dialogItself){
dialogItself.close();
}
}]
});
}
});
// hide empty menu items // hide empty menu items
$('#mainmenu > div > .collapse').each(function () { $('#mainmenu > div > .collapse').each(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment