| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 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/wp.9/wp-content/themes/woodmart/js/scripts/elements/ |
Upload File : |
(function($) {
$.each([
'frontend/element_ready/wd_accordion.default',
'frontend/element_ready/wd_single_product_tabs.default',
'frontend/element_ready/wd_single_product_reviews.default'
], function(index, value) {
woodmartThemeModule.wdElementorAddAction(value, function($wrapper) {
woodmartThemeModule.accordion();
$('.wc-tabs-wrapper, .woocommerce-tabs').trigger('init');
$wrapper.find('#rating').parent().find('> .stars').remove();
$wrapper.find('#rating').trigger('init');
});
});
var triggerReviewOpener = function() {
$('.tabs-layout-accordion .wd-accordion-title.tab-title-reviews:not(.active)').click();
}
woodmartThemeModule.accordion = function() {
var hash = window.location.hash;
var url = window.location.href;
// Single product.
$('.woocommerce-review-link')
.off('click', triggerReviewOpener)
.on('click', triggerReviewOpener);
// Element.
$('.wd-accordion').each(function() {
var $wrapper = $(this);
var $tabTitles = $wrapper.find('> .wd-accordion-item > .wd-accordion-title');
var $tabContents = $wrapper.find('> .wd-accordion-item > .wd-accordion-content');
var activeClass = 'wd-active';
var state = $wrapper.data('state');
var time = 300;
if ($wrapper.hasClass('wd-inited')) {
return;
}
var isTabActive = function(tabIndex) {
return $tabTitles.filter('[data-accordion-index="' + tabIndex + '"]').hasClass(activeClass);
};
var activateTab = function(tabIndex) {
var $requestedTitle = $tabTitles.filter('[data-accordion-index="' + tabIndex + '"]');
var $requestedContent = $tabContents.filter('[data-accordion-index="' + tabIndex + '"]');
$requestedTitle.addClass(activeClass);
$requestedContent.stop(true, true).slideDown(time).addClass(activeClass);
if ('first' === state && !$wrapper.hasClass('wd-inited')) {
if (! $requestedContent.length) {
$requestedContent = $tabContents.first();
}
$requestedContent.stop(true, true).show().css('display', 'block');
}
$wrapper.addClass('wd-inited');
woodmartThemeModule.$document.trigger('resize.vcRowBehaviour');
woodmartThemeModule.$document.trigger('wood-images-loaded');
};
var deactivateActiveTab = function() {
var $activeTitle = $tabTitles.filter('.' + activeClass);
var $activeContent = $tabContents.filter('.' + activeClass);
$activeTitle.removeClass(activeClass);
$activeContent.stop(true, true).slideUp(time).removeClass(activeClass);
};
var getFirstTabIndex = function() {
return $tabTitles.first().data('accordion-index');
};
if ('first' === state) {
activateTab(getFirstTabIndex());
}
$tabTitles.off('click').on('click', function() {
var $this = $(this);
var tabIndex = $(this).data('accordion-index');
var isActiveTab = isTabActive(tabIndex);
var currentIndex = $this.parent().index();
var oldIndex = $this.parent().siblings().find('.wd-active').parent('.wd-tab-wrapper').index();
if ($this.hasClass('wd-active') || currentIndex === -1) {
oldIndex = currentIndex;
}
if (isActiveTab || $this.hasClass(activeClass)) {
deactivateActiveTab();
} else {
deactivateActiveTab();
activateTab(tabIndex);
if ( ! $tabTitles.filter('[data-accordion-index="' + tabIndex + '"]').length ) {
$this.addClass(activeClass);
$this.siblings('.wd-accordion-content').stop(true, true).slideDown(time).addClass(activeClass)
}
}
if ($this.parents('.tabs-layout-accordion').length || $this.parents('.wd-single-tabs').length) {
setTimeout(function() {
if (woodmartThemeModule.$window.width() < 1024 && currentIndex > oldIndex) {
var $header = $('.whb-sticky-header');
var headerHeight = $header.length > 0 ? $header.outerHeight() : 0;
$('html, body').animate({
scrollTop: $this.offset().top - $this.outerHeight() - headerHeight - 50
}, 500);
}
}, time);
}
});
if (hash.toLowerCase().indexOf('comment-') >= 0 || hash === '#reviews' || hash === '#tab-reviews' || url.indexOf('comment-page-') > 0 || url.indexOf('cpage=') > 0) {
$wrapper.find('.tab-title-reviews').trigger('click');
}
});
};
$(document).ready(function() {
woodmartThemeModule.accordion();
});
})(jQuery);