Guard lt.* calls when base.js unavailable to prevent crash
Wraps all lt.keys.initDefaults() calls in `if (window.lt)` guards across 6 view files. Adds `if (!window.lt) return` bail-out in keyboard-shortcuts.js and `if (window.lt)` guard in settings.js DOMContentLoaded handler. This prevents TypeError crashes when /web_template/base.js returns 404, which was causing the admin menu click delegation to never register. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -816,6 +816,6 @@ $nonce = SecurityHeadersMiddleware::getNonce();
|
||||
|
||||
<script nonce="<?php echo $nonce; ?>" src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/keyboard-shortcuts.js"></script>
|
||||
<script nonce="<?php echo $nonce; ?>" src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/settings.js"></script>
|
||||
<script nonce="<?php echo $nonce; ?>">lt.keys.initDefaults();</script>
|
||||
<script nonce="<?php echo $nonce; ?>">if (window.lt) lt.keys.initDefaults();</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user