| 1 |
jQuery(document).ready(function(){ |
| 2 |
|
| 3 |
if( jQuery("#wppb-register-user").length ) { |
| 4 |
jQuery('#wppb-register-user').on('submit', function (e) { |
| 5 |
|
| 6 |
//disable the submit button |
| 7 |
jQuery('.form-submit #register').attr('disabled', true); |
| 8 |
|
| 9 |
}) |
| 10 |
} |
| 11 |
|
| 12 |
if( !window.wppb_disable_automatic_scrolling || window.wppb_disable_automatic_scrolling != 1 ){ |
| 13 |
//scroll to top on success message |
| 14 |
if( jQuery("#wppb_form_general_message").length ){ |
| 15 |
jQuery([document.documentElement, document.body]).animate({ scrollTop: jQuery("#wppb_form_general_message").offset().top }, 500); |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
// Fix for Select2 search not focusing |
| 20 |
jQuery(document).on('select2:open', function() { |
| 21 |
let allSelect2Found = document.querySelectorAll('.select2-container--open .select2-search__field'); |
| 22 |
allSelect2Found[allSelect2Found.length - 1].focus(); |
| 23 |
}) |
| 24 |
|
| 25 |
}) |