Allow an AJAX call to specify that it should not notify on error

Because there are some cases where it's OK to fail, and it's not the user's fault
This commit is contained in:
David Baumgold
2013-05-22 15:04:30 -04:00
parent 2359c43855
commit 0a7222b123
3 changed files with 24 additions and 16 deletions

View File

@@ -16,6 +16,8 @@ $ ->
dataType: 'json'
$(document).ajaxError (event, jqXHR, ajaxSettings, thrownError) ->
if ajaxSettings.notifyOnError is false
return
msg = new CMS.Models.ErrorMessage(
"title": gettext("Studio's having trouble saving your work")
"message": jqXHR.responseText || gettext("This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.")