/
githubmirror
/
obsidian-clipper
Обзор
Документация
Войти
/
githubmirror
/
obsidian-clipper
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/utils/routing.ts
17 строк
531 B
Steph Ango
Fix toggle state
27 ноя 2024, 00:10
27 ноя 2024, 00:10
ad8e53f
Код
Авторство
О чём код?
import { initializeToggles } from './ui-utils'; export function updateUrl(section: string, templateId?: string): void { let url = `${window.location.pathname}?section=${section}`; if (templateId) { url += `&template=${templateId}`; } window.history.pushState({}, '', url); } export function getUrlParameters(): { section: string | null, templateId: string | null } { const urlParams = new URLSearchParams(window.location.search); return { section: urlParams.get('section'), templateId: urlParams.get('template') }; }