PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.10.8
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.10.8
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / includes / core / widgets / block / wpfunnels-editor-script.js

wpfunnels-editor-script.js in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.10.8, at includes/core/widgets/block/wpfunnels-editor-script.js

60 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function ($) {
2
3 jQuery(document).ready(function () {
4 //--------start floating label script-------
5 $('.floating-label #customer_details .form-row .input-text, .floating-label form.woocommerce-form-login .form-row-first .input-text, .floating-label form.woocommerce-form-login .form-row-last .input-text').each(function(){
6 $(this).attr('placeholder', '');
7 console.log('default load');
8
9 if( $(this).val().length > 0 ) {
10 $(this).parents('.form-row').find('label').addClass('floated');
11 }
12 });
13
14 $(document).on('focus','.floating-label #customer_details .form-row .input-text, .floating-label #customer_details .form-row select, .floating-label form.woocommerce-form-login .form-row-first .input-text, .floating-label form.woocommerce-form-login .form-row-last .input-text', function(){
15 $(this).parents('.form-row').find('label').addClass('floated');
16 });
17
18 $(document).on('blur','.floating-label #customer_details .form-row .input-text, .floating-label #customer_details .form-row select, .floating-label form.woocommerce-form-login .form-row-first .input-text, .floating-label form.woocommerce-form-login .form-row-last .input-text', function(){
19 if( $(this).val().length == 0 ) {
20 $(this).parents('.form-row').find('label').removeClass('floated');
21 }
22 });
23
24 //--------end floating label script-------
25
26 // Initialize Enhanced Phone Field in editor
27 function initEditorPhoneField() {
28 if (typeof window.intlTelInput !== 'function' || !window.wpfnl_obj) {
29 return;
30 }
31
32 // Wait for phone fields that haven't been initialized yet
33 $('.wpfnl-phone, #billing_phone, input[type="tel"]').not('.wpfnl-iti-initialized').each(function() {
34 var input = this;
35 $(input).addClass('wpfnl-iti-initialized');
36
37 var iti = window.intlTelInput(input, {
38 initialCountry: "auto",
39 separateDialCode: true,
40 geoIpLookup: function(success, failure) {
41 $.get('https://ipinfo.io', function() {}, "jsonp").always(function(resp) {
42 var countryCode = (resp && resp.country) ? resp.country : "us";
43 success(countryCode);
44 });
45 },
46 utilsScript: window.wpfnl_obj.phone_utils_url,
47 });
48
49 if (window.wpfnl_obj.phone_help_text && !$(input).next('.wpfnl-phone-help-text').length) {
50 $('<p class="wpfnl-phone-help-text" style="font-size: 12px; margin-top: 5px; color: #666;">' + window.wpfnl_obj.phone_help_text + '</p>').insertAfter($(input).closest('.iti'));
51 }
52 });
53 }
54
55 // Polling to handle Gutenberg's dynamic rendering of components
56 setInterval(initEditorPhoneField, 1000);
57
58 });
59
60 })(jQuery);