1/* global woodmart_settings */ 2(function($) { 3 woodmartThemeModule.$document.on('wdBackHistory wdProductsTabsLoaded wdSearchFullScreenContentLoaded wdActionAfterAddToCart wdShopPageInit wdArrowsLoadProducts wdLoadMoreLoadProducts wdUpdateWishlist wdQuickViewOpen wdQuickShopSuccess wdProductBaseHoverIconsResize wdRecentlyViewedProductLoaded updated_checkout updated_cart_totals', function () { 4 woodmartThemeModule.btnsToolTips(); 5 }); 6 7 woodmartThemeModule.$document.on('wdUpdateTooltip', function (e, $this) { 8 woodmartThemeModule.updateTooltip($this); 9 }); 10 11 $.each([ 12 'frontend/element_ready/wd_products.default', 13 'frontend/element_ready/wd_products_tabs.default', 14 'frontend/element_ready/wd_single_product_nav.default', 15 'frontend/element_ready/wd_single_product_size_guide_button.default', 16 'frontend/element_ready/wd_single_product_compare_button.default', 17 'frontend/element_ready/wd_single_product_wishlist_button.default' 18 ], function(index, value) { 19 woodmartThemeModule.wdElementorAddAction(value, function() { 20 woodmartThemeModule.btnsToolTips(); 21 }); 22 }); 23 24 woodmartThemeModule.btnsToolTips = function() { 25 $('.woodmart-css-tooltip, .wd-buttons[class*="wd-pos-r"] div > a').on('mouseenter touchstart', function () { 26 var $this = $(this); 27 28 if ($this.hasClass('wd-tooltip-inited')) { 29 return; 30 } 31 32 $this.find('.wd-tooltip-label').remove(); 33 $this.addClass('wd-tltp').prepend('<span class="wd-tooltip-label">' + $this.text() + '</span>'); 34 35 $this.addClass('wd-tooltip-inited'); 36 }); 37 38 // Bootstrap tooltips 39 $('.wd-tooltip, .wd-hover-icons .wd-buttons .wd-action-btn:not(.wd-add-btn) > a, .wd-hover-icons .wd-buttons .wd-add-btn, body:not(.catalog-mode-on):not(.login-see-prices) .wd-hover-base .wd-bottom-actions .wd-action-btn.wd-style-icon:not(.wd-add-btn) > a, body:not(.catalog-mode-on):not(.login-see-prices) .wd-hover-base .wd-bottom-actions .wd-action-btn.wd-style-icon.wd-add-btn, .wd-hover-base .wd-compare-btn > a, .wd-products-nav .wd-btn-back, .wd-single-action-btn .wd-action-btn.wd-style-icon a').on('mouseenter touchstart', function() { 40 var $this = $(this); 41 42 if (!$this.hasClass('wd-hint') && woodmartThemeModule.windowWidth <= 1024 || $this.hasClass('wd-tooltip-inited')) { 43 return; 44 } 45 46 $this.tooltip({ 47 animation: false, 48 container: 'body', 49 trigger : 'hover', 50 boundary: 'window', 51 title : function() { 52 var $this = $(this); 53 54 if ($this.find('.added_to_cart').length > 0) { 55 return $this.find('.add_to_cart_button').text(); 56 } 57 58 if ($this.find('.add_to_cart_button').length > 0) { 59 return $this.find('.add_to_cart_button').text(); 60 } 61 62 if ($this.find('.wd-swatch-text').length > 0) { 63 return $this.find('.wd-swatch-text').text(); 64 } 65 66 return $this.text(); 67 } 68 }); 69 70 $this.tooltip('show'); 71 72 $this.addClass('wd-tooltip-inited'); 73 }); 74 }; 75 76 woodmartThemeModule.updateTooltip = function($this) { 77 var $tooltip = $($this); 78 79 if ( !$tooltip.hasClass('wd-tooltip-inited') ) { 80 $tooltip = $tooltip.parent('.wd-tooltip-inited'); 81 } 82 83 if (woodmartThemeModule.windowWidth <= 1024 || !$tooltip.hasClass('wd-tooltip-inited') || 'undefined' === typeof ($.fn.tooltip) || !$tooltip.is(':hover')) { 84 return; 85 } 86 87 $tooltip.tooltip('update').tooltip('show'); 88 }; 89 90 $(document).ready(function() { 91 woodmartThemeModule.btnsToolTips(); 92 }); 93})(jQuery); 94
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.