Skip to content

Commit

Permalink
preventUndefinedResponses option with default value true
Browse files Browse the repository at this point in the history
  • Loading branch information
KODerFunk committed Nov 14, 2012
1 parent 773688f commit 0ef0899
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/assets/javascripts/ultimate/flash.js.coffee
Expand Up @@ -49,6 +49,7 @@ class Ultimate.Plugins.Flash extends Ultimate.Plugin
flashClass: 'flash' # css-class of message container
showAjaxErrors: true # catch global jQuery.ajaxErrors(), try detect message and show it
showAjaxSuccesses: true # catch global jQuery.ajaxSuccessess(), try detect message and show it
preventUndefinedResponses: true # prevent error responses with status code < 100, often 0
detectFormErrors: true # can be function (parsedJSON)
detectPlainTextMaxLength: 200 # if response has plain text and its length fits, show it
productionMode: true
Expand Down Expand Up @@ -195,7 +196,7 @@ class Ultimate.Plugins.Flash extends Ultimate.Plugin
thrownError = text
text = @t('defaultErrorText')
# prevent undefined responses
return false if @productionMode and jqXHR.status < 100
return false if @preventUndefinedResponses and jqXHR.status < 100
# prevent recall
return false if jqXHR.breakFlash
jqXHR.breakFlash = true
Expand Down

0 comments on commit 0ef0899

Please sign in to comment.