Commit 66bdb108 authored by KR Moorhouse's avatar KR Moorhouse

Updated thank you message and processing spinner.

parent 3d38df43
......@@ -196,12 +196,12 @@
<input type="text" id="optin-email-address" value="<?php echo $current_user->user_email; ?>" style="width:100%; font-size:16px;">
</p>
<span id="optin-spinner" class="spinner"></span>
<div style="padding-top:15px; width:100%; clear:both;">
<div id="optin-buttons" style="padding-top:15px; width:100%; clear:both;">
<button id="optout" class="button-secondary" style="margin-bottom:10px; font-size:18px;">Not Now</button>
<button id="optin" class="button-primary" style="margin-bottom:10px; font-size:18px; float:right;">Yes, I agree!</button>
</div>
</div>
<div id="optin-thankyou" style="display:none;">
<div id="optin-thankyou" style="display:none; padding: 10px 15px; font-size:120%;">
Thank you for opting in!
</div>
\ No newline at end of file
......@@ -35,9 +35,11 @@ jQuery(document).ready(function($) {
// Show spinner
jQuery( '#optin-spinner' ).css( 'visibility', 'visible' );
jQuery( '#optin-buttons' ).css( 'visibility', 'hidden' );
// Hit AJAX endpoint and opt-in.
jQuery.post( ajaxurl, { action: 'ninja_forms_optin', send_email: sendEmail, user_email: userEmail }, function( response ) {
jQuery( '#optin-spinner' ).css( 'visibility', 'hidden' );
optinModal.setTitle( '<h2 style="font-size:150%;">Keep being awesome!</h2>' );
optinModal.setContent( jQuery( '#optin-thankyou' ) );
/**
* When we get a response from our endpoint, show a thank you and set a timeout
......@@ -55,10 +57,11 @@ jQuery(document).ready(function($) {
jQuery( '#optout' ).click( function( e ) {
// Show spinner
jQuery( '#optin-spinner' ).attr( 'visibility', 'visible' );
jQuery( '#optin-spinner' ).css( 'visibility', 'visible' );
jQuery( '#optin-buttons' ).css( 'visibility', 'hidden' );
// Hit AJAX endpoint and opt-in.
jQuery.post( ajaxurl, { action: 'ninja_forms_optout' }, function( response ) {
jQuery( '#optin-spinner' ).attr( 'visibility', 'hidden' );
jQuery( '#optin-spinner' ).css( 'visibility', 'hidden' );
// When we get a response from our endpoint, close the modal.
optinModal.close();
} );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment