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:
Mike Jolley 2016-02-11 11:17:49 +00:00
commit b0e2732140
2 changed files with 8 additions and 1 deletions

View File

@ -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