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/offCanvasMyAccount.js
/* global xts_settings */
(function($) {
	XTSThemeModule.offCanvasMyAccount = function () {
		var $closeSide = $('.xts-close-side');
		var $element = $('.xts-login-side');
		var $body = XTSThemeModule.$body;

		$body.on('click', '.xts-header-my-account.xts-opener, .xts-login-to-price-msg.xts-opener, .xts-menu-item-account.xts-opener, .xts-navbar-my-account.xts-opener', function (e) {
			e.preventDefault();

			if ($element.hasClass('xts-opened')) {
				hideWidget();
			} else {
				setTimeout(function() {
					showWidget();
				}, 100);
			}
		});

		$body.on('click touchstart', '.xts-close-side', function () {
			hideWidget();
		});

		$body.on('click touchstart', '.xts-close-button a', function (e) {
			e.preventDefault();
			hideWidget();
		});

		XTSThemeModule.$document.on('keyup', function (e) {
			if (27 === e.keyCode) {
				hideWidget();
			}
		});

		var showWidget = function () {
			XTSThemeModule.$document.trigger('xtsOffCanvasMyAccountShown');
			$element.addClass('xts-opened');
			$closeSide.addClass('xts-opened');
		};

		var hideWidget = function () {
			$element.removeClass('xts-opened');
			$closeSide.removeClass('xts-opened');
		};

		if ( $element.find('.woocommerce-notices-wrapper > ul').length > 0 ) {
			showWidget();
		}
	};

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