fix: theme flash + language persistence on navigation
- Remove setTimeout re-application of theme in app-init.js that caused flash - Fix quotations.html: add missing i18n.js and correct script load order - Fix whatsapp.html: add missing app-init.js before sidebar.js - Ensure i18n.js always loads before sidebar.js for proper translation
This commit is contained in:
@@ -167,12 +167,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also prevent any DOMContentLoaded theme switchers from overriding
|
|
||||||
// by re-applying our saved theme after a tick
|
|
||||||
setTimeout(function() {
|
|
||||||
document.documentElement.setAttribute('data-theme', savedTheme);
|
|
||||||
}, 100);
|
|
||||||
|
|
||||||
// ─── Expose globally ───
|
// ─── Expose globally ───
|
||||||
window.POS_USER = {
|
window.POS_USER = {
|
||||||
name: name,
|
name: name,
|
||||||
|
|||||||
@@ -14,8 +14,9 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script src="/pos/static/js/pos-utils.js" defer></script>
|
<script src="/pos/static/js/pos-utils.js" defer></script>
|
||||||
<script src="/pos/static/js/sidebar.js" defer></script>
|
<script src="/pos/static/js/i18n.js" defer></script>
|
||||||
<script src="/pos/static/js/app-init.js" defer></script>
|
<script src="/pos/static/js/app-init.js" defer></script>
|
||||||
|
<script src="/pos/static/js/sidebar.js" defer></script>
|
||||||
|
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<h1 class="page-title">Cotizaciones</h1>
|
<h1 class="page-title">Cotizaciones</h1>
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ function posLogout(){localStorage.removeItem('pos_token');window.location.href='
|
|||||||
|
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
<script src="/pos/static/js/i18n.js" defer></script>
|
<script src="/pos/static/js/i18n.js" defer></script>
|
||||||
|
<script src="/pos/static/js/app-init.js" defer></script>
|
||||||
<script src="/pos/static/js/whatsapp2.js?v=5" defer></script>
|
<script src="/pos/static/js/whatsapp2.js?v=5" defer></script>
|
||||||
<script src="/pos/static/js/pos-utils.js" defer></script>
|
<script src="/pos/static/js/pos-utils.js" defer></script>
|
||||||
<script src="/pos/static/js/sidebar.js" defer></script>
|
<script src="/pos/static/js/sidebar.js" defer></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user