Created
March 25, 2018 02:31
-
-
Save zmonteca/0f12376b2707c90e0d23c181ae200d22 to your computer and use it in GitHub Desktop.
// line 7 needs a conditions to check if $anchor['id'] exists. if this isn't in place, requesting confirmations asynchronously that completely replace the form bork. Then loading subsequent asyn forms do not work because there is a script error on the page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( $ajax && ! $is_postback ) { | |
$spinner_url = gf_apply_filters( array( 'gform_ajax_spinner_url', $form_id ), GFCommon::get_base_url() . '/images/spinner.gif', $form ); | |
$scroll_position = array( 'default' => '', 'confirmation' => '' ); | |
if ( $anchor['scroll'] !== false ) { | |
$scroll_position['default'] = is_numeric( $anchor['scroll'] ) ? 'jQuery(document).scrollTop(' . intval( $anchor['scroll'] ) . ');' : "jQuery(document).scrollTop(jQuery('#gform_wrapper_{$form_id}').offset().top);"; | |
$scroll_position['confirmation'] = is_numeric( $anchor['scroll'] ) ? 'jQuery(document).scrollTop(' . intval( $anchor['scroll'] ) . ');' : "if(jQuery('{$anchor['id']}').length) { jQuery(document).scrollTop(jQuery('{$anchor['id']}').offset().top); }"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment