Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/waymondo/turboboost
Browse files Browse the repository at this point in the history
  • Loading branch information
waymondo committed Oct 19, 2016
2 parents 43d57b5 + 0005e7d commit 010e326
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/assets/javascripts/turboboost/turboboost.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ turboboostFormError = (e, errors) ->
turboboostComplete = (e, resp) ->
$el = $(@)
isForm = @nodeName is "FORM"
status = parseInt(resp.status)

if 200 <= resp.status < 300
if 200 <= status < 300
$el.trigger "turboboost:success", tryJSONParse resp.getResponseHeader('X-Flash')
$el.find(errID).remove() if Turboboost.insertErrors and isForm
if (location = resp.getResponseHeader('Location')) and !$el.attr('data-no-turboboost-redirect')
Expand All @@ -58,7 +59,7 @@ turboboostComplete = (e, resp) ->
else
enableForm $el if isForm and Turboboost.handleFormDisabling
$inserted = maybeInsertSuccessResponseBody(resp)
else if 400 <= resp.status < 600
else if 400 <= status < 600
enableForm $el if isForm and Turboboost.handleFormDisabling
$el.trigger "turboboost:error", resp.responseText

Expand Down

0 comments on commit 010e326

Please sign in to comment.