PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.3.1
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.3.1
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / assets / js / modules / size-chart / size-chart.js
assets/js/modules/size-chart
size-chart.js 1.7 KB 1 month ago size-chart.min.js 1.0 KB 1 month ago

size-chart.js in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 2.3.1, at assets/js/modules/size-chart/size-chart.js

44 lines 1.7 KB Raw Download Zip
1 'use strict';
2
3 var merchant = merchant || {};
4 merchant.modules = merchant.modules || {};
5 (function ($) {
6 merchant.modules.sizeChart = {
7 init: function init($wrapper) {
8 var $sizeChart = $wrapper ? $wrapper.find('.merchant-product-size-chart') : $('.merchant-product-size-chart');
9 if (!$sizeChart.length) {
10 return;
11 }
12 var $body = $('body');
13 var $button = $sizeChart.find('.merchant-product-size-chart-button a');
14 var $modal = $sizeChart.find('.merchant-product-size-chart-modal');
15 $button.on('click', function (e) {
16 e.preventDefault();
17 $body.addClass('merchant-product-size-chart-modal-open');
18 });
19 $modal.on('click', function (e) {
20 e.preventDefault();
21 var $target = $(e.target);
22 var $content = $sizeChart.find('.merchant-product-size-chart-modal-content');
23 if ($target.is($modal) || $target.closest('.merchant-product-size-chart-modal-close').length) {
24 $content.scrollTop(0);
25 $body.removeClass('merchant-product-size-chart-modal-open');
26 }
27 });
28 var $tabs = $sizeChart.find('.merchant-product-size-chart-modal-tab');
29 var $tables = $sizeChart.find('.merchant-product-size-chart-modal-table');
30 if ($tabs.length && $tables.length) {
31 $tabs.each(function () {
32 var $tab = $(this);
33 $tab.on('click', function () {
34 $tab.addClass('active').siblings().removeClass('active');
35 $tables.eq($tab.index()).addClass('active').siblings().removeClass('active');
36 });
37 });
38 }
39 }
40 };
41 $(document).ready(function () {
42 merchant.modules.sizeChart.init();
43 });
44 })(jQuery);