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/productQuickView.js
/* global xts_settings */
(function($) {
	$.each([
		'frontend/element_ready/xts_products.default',
		'frontend/element_ready/xts_single_product_tabs.default'
	], function(index, value) {
		XTSThemeModule.xtsElementorAddAction(value, function() {
			XTSThemeModule.productQuickView();
		});
	});

	XTSThemeModule.productQuickView = function() {
		XTSThemeModule.$document.on('click', '.xts-quick-view-btn a', function(e) {
			e.preventDefault();

			if ($('.xts-quick-view-btn a').hasClass('xts-loading')) {
				return true;
			}

			var $btn = $(this);
			var productId = $btn.data('id');
			var data = {
				id    : productId,
				action: 'xts_quick_view'
			};

			$btn.addClass('xts-loading');

			var initPopup = function(data) {
				$.magnificPopup.open({
					items       : {
						src : '<div class="mfp-with-anim xts-popup-content xts-quick-view-popup">' + data + '</div>',
						type: 'inline'
					},
					tClose      : xts_settings.magnific_close,
					tLoading    : xts_settings.magnific_loading,
					removalDelay: 400, //delay removal by X to allow out-animation
					preloader   : false,
					callbacks   : {
						beforeOpen: function() {
							this.st.mainClass = 'xts-popup-effect';
						},
						open      : function() {
							var $variationsForm = $('.xts-quick-view-popup .variations_form');
							$variationsForm.wc_variation_form().find('.variations select:eq(0)').trigger('change');
							$variationsForm.trigger('wc_variation_form');

							XTSThemeModule.$document.trigger('xtsProductQuickViewOpen');
						}
					}
				});
			};

			$.ajax({
				url     : xts_settings.ajaxurl,
				data    : data,
				method  : 'get',
				success : function(data) {
					if (xts_settings.quick_view_in_popup_fix) {
						$.magnificPopup.close();
						setTimeout(function() {
							initPopup(data);
						}, 500);
					} else {
						initPopup(data);
					}
				},
				complete: function() {
					$btn.removeClass('xts-loading');
				}
			});
		});
	};

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