mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Hide stripe load indicator when a redirect response is returned (#5321)
Fixes #5055
This commit is contained in:
parent
cbcb3894b0
commit
aa9c209e76
3
modules/system/assets/js/framework-min.js
vendored
3
modules/system/assets/js/framework-min.js
vendored
@ -69,7 +69,8 @@ var fieldElement=$form.find('[name="'+fieldName+'"], [name="'+fieldName+'[]"], [
|
||||
if(fieldElement.length>0){var _event=jQuery.Event('ajaxInvalidField')
|
||||
$(window).trigger(_event,[fieldElement.get(0),fieldName,fieldMessages,isFirstInvalidField])
|
||||
if(isFirstInvalidField){if(!_event.isDefaultPrevented())fieldElement.focus()
|
||||
isFirstInvalidField=false}}})},handleFlashMessage:function(message,type){},handleRedirectResponse:function(url){window.location.assign(url)},handleUpdateResponse:function(data,textStatus,jqXHR){var updatePromise=$.Deferred().done(function(){for(var partial in data){var selector=(options.update[partial])?options.update[partial]:partial
|
||||
isFirstInvalidField=false}}})},handleFlashMessage:function(message,type){},handleRedirectResponse:function(url){window.location.assign(url)
|
||||
$el.trigger('ajaxDone')},handleUpdateResponse:function(data,textStatus,jqXHR){var updatePromise=$.Deferred().done(function(){for(var partial in data){var selector=(options.update[partial])?options.update[partial]:partial
|
||||
if($.type(selector)=='string'&&selector.charAt(0)=='@'){$(selector.substring(1)).append(data[partial]).trigger('ajaxUpdate',[context,data,textStatus,jqXHR])}
|
||||
else if($.type(selector)=='string'&&selector.charAt(0)=='^'){$(selector.substring(1)).prepend(data[partial]).trigger('ajaxUpdate',[context,data,textStatus,jqXHR])}
|
||||
else{$(selector).trigger('ajaxBeforeReplace')
|
||||
|
@ -69,7 +69,8 @@ var fieldElement=$form.find('[name="'+fieldName+'"], [name="'+fieldName+'[]"], [
|
||||
if(fieldElement.length>0){var _event=jQuery.Event('ajaxInvalidField')
|
||||
$(window).trigger(_event,[fieldElement.get(0),fieldName,fieldMessages,isFirstInvalidField])
|
||||
if(isFirstInvalidField){if(!_event.isDefaultPrevented())fieldElement.focus()
|
||||
isFirstInvalidField=false}}})},handleFlashMessage:function(message,type){},handleRedirectResponse:function(url){window.location.assign(url)},handleUpdateResponse:function(data,textStatus,jqXHR){var updatePromise=$.Deferred().done(function(){for(var partial in data){var selector=(options.update[partial])?options.update[partial]:partial
|
||||
isFirstInvalidField=false}}})},handleFlashMessage:function(message,type){},handleRedirectResponse:function(url){window.location.assign(url)
|
||||
$el.trigger('ajaxDone')},handleUpdateResponse:function(data,textStatus,jqXHR){var updatePromise=$.Deferred().done(function(){for(var partial in data){var selector=(options.update[partial])?options.update[partial]:partial
|
||||
if($.type(selector)=='string'&&selector.charAt(0)=='@'){$(selector.substring(1)).append(data[partial]).trigger('ajaxUpdate',[context,data,textStatus,jqXHR])}
|
||||
else if($.type(selector)=='string'&&selector.charAt(0)=='^'){$(selector.substring(1)).prepend(data[partial]).trigger('ajaxUpdate',[context,data,textStatus,jqXHR])}
|
||||
else{$(selector).trigger('ajaxBeforeReplace')
|
||||
|
@ -288,6 +288,11 @@ if (window.jQuery.request !== undefined) {
|
||||
*/
|
||||
handleRedirectResponse: function(url) {
|
||||
window.location.assign(url)
|
||||
// Indicate that the AJAX request is finished if we're still on the current page
|
||||
// so that the loading indicator for redirects that cause a browser to download
|
||||
// a file instead of leave the page will properly stop.
|
||||
// @see https://github.com/octobercms/october/issues/5055
|
||||
$el.trigger('ajaxDone')
|
||||
},
|
||||
|
||||
/*
|
||||
@ -974,4 +979,4 @@ if (window.jQuery.request !== undefined) {
|
||||
return sanitize(html)
|
||||
};
|
||||
|
||||
}(window);
|
||||
}(window);
|
||||
|
Loading…
x
Reference in New Issue
Block a user