A defined loader should not hide when there is a redirect taking place

This commit is contained in:
Sam Georges 2014-09-28 12:23:18 +10:00
parent 8ca3483863
commit beab3c3ded
1 changed files with 8 additions and 3 deletions

View File

@ -252,14 +252,19 @@ if (window.jQuery === undefined)
$el.trigger('ajaxPromise')
return $.ajax(requestOptions)
.fail(function(jqXHR, textStatus, errorThrown){
if (!isRedirect) $el.trigger('ajaxFail', [context, textStatus, jqXHR])
if (!isRedirect) {
$el.trigger('ajaxFail', [context, textStatus, jqXHR])
if (loading) loading.hide()
}
})
.done(function(data, textStatus, jqXHR){
if (!isRedirect) $el.trigger('ajaxDone', [context, data, textStatus, jqXHR])
if (!isRedirect) {
$el.trigger('ajaxDone', [context, data, textStatus, jqXHR])
if (loading) loading.hide()
}
})
.always(function(dataOrXhr, textStatus, xhrOrError){
$el.trigger('ajaxAlways', [context, dataOrXhr, textStatus, xhrOrError])
if (loading) loading.hide()
})
}