| Server IP : 38.190.208.107 / Your IP : 216.73.216.152 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/test19.chuangfenglink.xyz/wp-content/themes/woodmart/js/scripts/wc/ |
Upload File : |
/* global woodmart_settings */
(function($) {
woodmartThemeModule.$document.on('wdShopPageInit wdUpdateWishlist wdArrowsLoadProducts wdLoadMoreLoadProducts wdProductsTabsLoaded wdSearchFullScreenContentLoaded wdArrowsLoadProducts wdBackHistory wdRecentlyViewedProductLoaded', function() {
woodmartThemeModule.productHover();
});
woodmartThemeModule.wcTabsHoverFix = function() {
$('.wc-tabs > li').on('click', function() {
woodmartThemeModule.productHover();
});
};
woodmartThemeModule.$document.on('wdProductHoverContentRecalc', function(event, $product) {
woodmartThemeModule.productHoverRecalc($product);
});
$.each([
'frontend/element_ready/wd_products.default',
'frontend/element_ready/wd_products_tabs.default'
], function(index, value) {
woodmartThemeModule.wdElementorAddAction(value, function() {
woodmartThemeModule.productHover();
});
});
woodmartThemeModule.productHoverRecalc = function($el) {
if ($el.hasClass('wd-fade-off')) {
return;
}
var heightHideInfo = $el.find('.wd-product-card-hover').outerHeight();
$el.find('.wd-product-card-bg').css({
marginBottom: -heightHideInfo
});
$el.addClass('hover-ready');
};
woodmartThemeModule.productHover = function() {
var $hoverBase = $('.wd-hover-with-fade');
var $carousel = $hoverBase.closest('.wd-carousel');
if (woodmartThemeModule.windowWidth <= 1024) {
if ( $carousel.length > 0 && $hoverBase.hasClass('wd-hover-fw-button')) {
$hoverBase.addClass('wd-fade-off');
}
$hoverBase.on('click', function(e) {
var $this = $(this);
var hoverClass = 'state-hover';
if (!$this.hasClass('wp-block-wd-li-product-card') && !$this.hasClass(hoverClass) && !$this.hasClass('wd-fade-off') && woodmart_settings.base_hover_mobile_click === 'no') {
e.preventDefault();
$('.' + hoverClass).removeClass(hoverClass);
$this.addClass(hoverClass);
}
});
woodmartThemeModule.$document.on('click touchstart', function(e) {
if ($(e.target).closest('.state-hover').length === 0) {
$('.state-hover').removeClass('state-hover');
}
});
}
$hoverBase.on('mouseenter mousemove touchstart', function() {
var $product = $(this);
if ($product.hasClass('wd-height-calculated')) {
return;
}
$product.imagesLoaded(function() {
woodmartThemeModule.productHoverRecalc($product);
});
$product.addClass('wd-height-calculated');
});
function productHolderWidth($holder) {
if ($holder.data('column_width')) {
return;
}
var holderWidth = $holder.outerWidth();
var columns = $holder.data('columns');
var columnWidth = holderWidth / columns;
$holder.data('column_width', columnWidth);
}
$('.wd-products').on('mouseenter mousemove touchstart', function() {
productHolderWidth($(this));
});
$hoverBase.on('mouseenter mousemove touchstart', function() {
if (!woodmart_settings.hover_width_small) {
return;
}
var $this = $(this);
if ($this.hasClass('wd-hover-fw-button') || $this.hasClass('wp-block-wd-li-product-card')) {
return;
}
productHolderWidth($this.parent('.wd-products'));
var columnWidth = $this.parent('.wd-products').data('column_width');
if (!columnWidth) {
return;
}
if (255 > columnWidth || woodmartThemeModule.windowWidth <= 1024) {
$this.find('.wd-add-btn').parent().addClass('wd-add-small-btn');
$this.find('.wd-add-btn').removeClass('wd-add-btn-replace').addClass('wd-action-btn wd-style-icon wd-add-cart-icon');
} else if (woodmartThemeModule.$body.hasClass('catalog-mode-on') || woodmartThemeModule.$body.hasClass('login-see-prices')) {
$this.find('.wd-bottom-actions .wd-action-btn').removeClass('wd-style-icon').addClass('wd-style-text');
}
woodmartThemeModule.$document.trigger('wdProductBaseHoverIconsResize');
});
};
$(document).ready(function() {
woodmartThemeModule.productHover();
woodmartThemeModule.wcTabsHoverFix();
});
})(jQuery);