Hook up notification framework to default AJAX error callback

And delete `CMS.ServerError`
This commit is contained in:
David Baumgold
2013-05-10 14:17:30 -04:00
parent e2f5acef46
commit c6c5e50d86
9 changed files with 42 additions and 54 deletions

View File

@@ -109,6 +109,25 @@
</%text>
<script src="${static.url('js/models/feedback.js')}"></script>
<script src="${static.url('js/views/feedback.js')}"></script>
<script type="text/javascript">
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
var m = new CMS.Models.SystemFeedback({
"type": "error",
"title": "Server Error",
"message": jqXHR.responseText,
"actions": {
"primary": {
"text": "Dismiss",
"click": function(model) {
model.hide();
}
}
}
});
new CMS.Views.Notification({model: m});
return m;
})
</script>
<!-- view -->
<div class="wrapper wrapper-view">