Додан моніторінг застосунку
Додани веб компоненти карточок територій та повідомлень
This commit is contained in:
@@ -123,7 +123,12 @@ const Router = {
|
||||
// Делегування кліків по посиланнях з data-route
|
||||
delegateLinks() {
|
||||
window.addEventListener('click', (e) => {
|
||||
const target = e.target.closest('[data-route]');
|
||||
// const target = e.target.closest('[data-route]');
|
||||
const pathNodes = e.composedPath();
|
||||
const target = pathNodes.find(node =>
|
||||
node.tagName === 'A' && node.hasAttribute('data-route')
|
||||
);
|
||||
|
||||
if (!target || !target.href) return;
|
||||
|
||||
const path = target.href.replace(location.origin, '');
|
||||
@@ -148,7 +153,7 @@ const Router = {
|
||||
location.hash = this.clearSlashes(path);
|
||||
}
|
||||
|
||||
if(update == true) {
|
||||
if (update == true) {
|
||||
window.scrollTo(0, 0); // Скидуємо прокрутку при переході
|
||||
this.check();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user