fix navigation elements
This commit is contained in:
@@ -46,6 +46,17 @@
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигационная шапка -->
|
||||
<header class="nav-header">
|
||||
<div class="nav-container">
|
||||
<a href="javascript:;" id="nav-home-link" class="nav-logo">Анонимные опросы</a>
|
||||
<nav class="nav-menu">
|
||||
<a href="javascript:;" id="nav-main-link" class="nav-link">Главная</a>
|
||||
<a href="javascript:;" id="nav-create-link" class="nav-link active">Создать опрос</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="container">
|
||||
<h1>Создание нового опроса</h1>
|
||||
|
||||
@@ -158,5 +169,19 @@
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<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;
|
||||
document.getElementById('nav-main-link').href = basePath;
|
||||
document.getElementById('nav-create-link').href = basePath + '/create';
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user