HEX
Server: LiteSpeed
System: Linux linux31.centraldnserver.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: salamatk (1501)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open
Upload Files
File: /home/salamatk/takarzan.ir/wp-content/themes/xts-luman/js/scripts/singleProductAccordion.js
/* global xts_settings */
(function($) {
	// $.each([
	// 	'frontend/element_ready/xts_accordion.default',
	// 	'frontend/element_ready/xts_single_product_tabs.default'
	// ], function(index, value) {
	// 	XTSThemeModule.xtsElementorAddAction(value, function() {
	// 	});
	// });
	// 

	XTSThemeModule.singleProductAccordion = function() {
		var $accordion = $('.wc-tabs-wrapper.xts-accordion');
		var $tabTitles = $accordion.find('.xts-accordion-title');
		var hash = window.location.hash;
		var url = window.location.href;

		if (
			hash.toLowerCase().indexOf('comment-') >= 0 ||
			hash === '#reviews' ||
			hash === '#tab-reviews' ||
			url.indexOf('comment-page-') > 0 ||
			url.indexOf('cpage=') > 0
		) {
			var firstTabIndex = $tabTitles.first().data('accordion-index');
			var reviewsTabIndex = $tabTitles.filter('[data-accordion-index="reviews"]').data('accordion-index');
			$tabTitles.filter('[data-accordion-index="' + firstTabIndex + '"]').removeClass('xts-active');
			$tabTitles.filter('[data-accordion-index="' + reviewsTabIndex + '"]').addClass('xts-active');
		}

		XTSThemeModule.$body.on('click', '.wc-tabs li a, ul.tabs li a', function(e) {

			e.preventDefault();
			// var index = $(this).data('tab-index');
			// $accordion.find('[data-accordion-index="' + index + '"]').click();
			XTSThemeModule.$document.trigger('xtsSingleProductAccordionClick');
		});
	};

	$(document).ready(function() {
		XTSThemeModule.singleProductAccordion();
	});
})(jQuery);