Merge pull request #10319 from justinshreve/terms-ajax-refresh-10309
Keep track of terms & conditions state and recheck the box if necessary
This commit is contained in:
commit
b0e2732140
|
@ -277,6 +277,8 @@ jQuery( function( $ ) {
|
|||
return;
|
||||
}
|
||||
|
||||
var termsCheckBoxChecked = $( '#terms' ).prop( 'checked' );
|
||||
|
||||
// Always update the fragments
|
||||
if ( data && data.fragments ) {
|
||||
$.each( data.fragments, function ( key, value ) {
|
||||
|
@ -285,6 +287,11 @@ jQuery( function( $ ) {
|
|||
} );
|
||||
}
|
||||
|
||||
// Recheck the terms and conditions box, if needed
|
||||
if ( termsCheckBoxChecked ) {
|
||||
$( '#terms' ).prop( 'checked', true );
|
||||
}
|
||||
|
||||
// Check for error
|
||||
if ( 'failure' === data.result ) {
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue