gravity forms update

This commit is contained in:
Tony Volpe
2024-06-17 15:47:38 -04:00
parent e4e274a9a7
commit c52ceefa4b
85 changed files with 359 additions and 295 deletions

View File

@@ -861,7 +861,7 @@ class GFFormDisplay {
$post_render_script = '
jQuery(document).trigger("gform_pre_post_render", [{ formId: "' . $form_id . '", currentPage: "' . $current_page . '", abort: function() { this.preventDefault(); } }]);
if (event.defaultPrevented) {
if (event && event.defaultPrevented) {
return;
}
const gformWrapperDiv = document.getElementById( "gform_wrapper_' . $form_id . '" );
@@ -4810,23 +4810,23 @@ class GFFormDisplay {
</div>";
}
if ( ! $ajax ) {
/**
* Allows users to disable the spinner on non-ajax forms.
*
* @since 2.7
*
* @param bool $show Whether to show the spinner on non-ajax-forms.
*
* @return bool
*/
$always_show_spinner = gf_apply_filters( array( 'gform_always_show_spinner', $form_id ), true );
/**
* Allows users to disable the spinner on non-ajax forms.
*
* @since 2.7
*
* @param bool $show Whether to show the spinner on non-ajax-forms.
*
* @return bool
*/
$always_show_spinner = gf_apply_filters( array( 'gform_always_show_spinner', $form_id ), true );
if ( ! $ajax && $always_show_spinner ) {
$default_spinner = GFCommon::get_base_url() . '/images/spinner.svg';
$spinner_url = gf_apply_filters( array( 'gform_ajax_spinner_url', $form_id ), $default_spinner, $form );
$theme_slug = self::get_form_theme_slug( $form );
$is_legacy = $default_spinner !== $spinner_url || in_array( $theme_slug, array( 'gravity-theme', 'legacy' ) );
$text .= '<script>gform.initializeOnLoaded( function() {' .
$resume_form .= '<script>gform.initializeOnLoaded( function() {' .
"gformInitSpinner( {$form_id}, '{$spinner_url}', " . ( $is_legacy ? 'true' : 'false' ) . " );" .
" });</script>";
}