<?php\n/**\n * Plugin Name: LK Tronics Mobile Menu & Popup Fix\n * Description: Compatibility fix for Elementor Pro popup with Elementor 4.x and mobile menu capture trigger.\n * Version: 1.0.0\n * Author: LK Tronics\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n    exit;\n}\n\n// 1. Compatibility shim for Elementor Pro 3.19 on Elementor Core 4.x\nadd_action( 'wp_head', function() {\n    ?>\n    <script id="lkt-elementor-compat-shim" data-cfasync="false">\n    (function() {\n        window.elementorModules = window.elementorModules || {};\n        window.elementorModules.frontend = window.elementorModules.frontend || {};\n        window.elementorModules.frontend.handlers = window.elementorModules.frontend.handlers || {};\n        if (!window.elementorModules.frontend.handlers.NestedTabs) {\n            window.elementorModules.frontend.handlers.NestedTabs = window.elementorModules.frontend.handlers.Base || class {};\n        }\n    })();\n    </script>\n    <?php\n}, 0 );\n\n// 2. Capture phase click listener: Prevents querySelector crash and reliably opens Popup 846\nadd_action( 'wp_footer', function() {\n    ?>\n    <script id="lkt-mobile-menu-trigger" data-cfasync="false">\n    (function() {\n        document.addEventListener('click', function(e) {\n            var btn = e.target.closest('a[href*="846"], a[href*="action%3Dpopup"], .elementor-element-f946c31 a, .elementor-element-f946c31');\n            if (!btn) return;\n\n            // Stop smooth-scroll listener from attempting querySelector on the invalid hash\n            e.preventDefault();\n            e.stopPropagation();\n\n            // Method A: Elementor Pro Popup API\n            if (window.elementorProFrontend && window.elementorProFrontend.modules && window.elementorProFrontend.modules.popup) {\n                try {\n                    window.elementorProFrontend.modules.popup.showPopup({ id: '846' });\n                    return;\n                } catch(err) {\n                    console.warn('elementorProFrontend popup call warning:', err);\n                }\n            }\n\n            // Method B: jQuery event trigger\n            if (window.jQuery) {\n                try {\n                    window.jQuery(document).trigger('elementor/popup/show', [{ id: 846 }]);\n                    return;\n                } catch(err) {}\n            }\n\n            // Method C: Direct DOM fallback\n            var popup = document.querySelector('.elementor-846, [data-elementor-id="846"]');\n            if (popup) {\n                var dialog = popup.closest('.dialog-widget') || popup;\n                dialog.style.display = 'block';\n                dialog.style.visibility = 'visible';\n                dialog.style.opacity = '1';\n            }\n        }, true);\n    })();\n    </script>\n    <?php\n}, 999 );\n<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//home.lk-tronics.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://home.lk-tronics.com/page-sitemap.xml</loc>
		<lastmod>2025-05-15T08:11:20+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->