fix navigation elements

This commit is contained in:
Primakov Alexandr Alexandrovich
2025-03-12 09:12:09 +03:00
parent b5301f948a
commit f91f821f86
6 changed files with 119 additions and 8 deletions

View File

@@ -46,6 +46,13 @@
</script>
</head>
<body>
<!-- Навигационная шапка -->
<header class="nav-header">
<div class="nav-container">
<a href="javascript:;" id="nav-home-link" class="nav-logo">Анонимные опросы</a>
</div>
</header>
<div class="container">
<div id="loading">Загрузка опроса...</div>
@@ -74,5 +81,17 @@
</div>
</div>
</div>
<script>
// Добавляем корректные пути к ссылкам после загрузки страницы
document.addEventListener('DOMContentLoaded', function() {
// Определяем базовый путь с учетом /ms в продакшен-версии
const isMsPath = window.location.pathname.includes('/ms/questioneer');
const basePath = isMsPath ? '/ms/questioneer' : '/questioneer';
// Устанавливаем правильные ссылки
document.getElementById('nav-home-link').href = basePath;
});
</script>
</body>
</html>