PluginProbe
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder / 51.1.87
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder v51.1.87
51.1.87 51.1.86 51.1.84 51.1.85 51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 All 41 releases
king-addons / includes / widgets / Woo_Checkout_Coupon / script.js

script.js in King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder 51.1.87, at includes/widgets/Woo_Checkout_Coupon/script.js

22 lines 655 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Checkout Coupon widget: open the coupon form when the notice banner is tapped.
3 *
4 * WooCommerce only binds a.showcoupon. On narrow viewports the link wraps, so
5 * most of the banner's hit area is the parent div and the form stays closed.
6 */
7 (function ($) {
8 'use strict';
9
10 $(document).on('click', '.ka-woo-checkout-coupon .woocommerce-form-coupon-toggle', function (event) {
11 if (event.target.closest('a.showcoupon')) {
12 return;
13 }
14 const link = this.querySelector('a.showcoupon');
15 if (!link) {
16 return;
17 }
18 event.preventDefault();
19 link.click();
20 });
21 })(jQuery);
22