Обновить UI-ветку

This commit is contained in:
2026-09-01 12:32:50 +03:00
parent 63b66c48d8
commit 3ae9d9175f
9 changed files with 921 additions and 115 deletions
+13 -4
View File
@@ -938,6 +938,9 @@ function closeTopChannelsMenu(listState) {
listState.topMenuCleanup();
}
listState.topMenuCleanup = null;
listState.topMenuAnchor?.setAttribute('aria-expanded', 'false');
listState.topMenuAnchor?.classList.remove('menu-open-pressed');
listState.topMenuAnchor = null;
const root = document.getElementById('modal-root');
if (root) {
const overlay = root.querySelector(`#${TOP_MENU_OVERLAY_ID}`);
@@ -989,9 +992,6 @@ function openTopChannelsMenu({
if (item.divider) {
const divider = document.createElement('div');
divider.className = 'channel-menu-divider';
divider.style.height = '1px';
divider.style.background = 'rgba(255,255,255,0.08)';
divider.style.margin = '6px 0';
menu.append(divider);
return;
}
@@ -1008,6 +1008,9 @@ function openTopChannelsMenu({
overlay.append(menu);
root.append(overlay);
anchorEl.setAttribute('aria-expanded', 'true');
anchorEl.classList.add('menu-open-pressed');
listState.topMenuAnchor = anchorEl;
const onOverlayClick = (event) => {
if (event.target === overlay) closeTopChannelsMenu(listState);
@@ -1355,6 +1358,7 @@ export function render({ navigate, route, chrome }) {
const listState = {
openMenuId: null,
topMenuCleanup: null,
topMenuAnchor: null,
notificationsState,
revealedCounters: new Set(),
channels: [],
@@ -1381,11 +1385,16 @@ export function render({ navigate, route, chrome }) {
topMenuBtn.type = 'button';
topMenuBtn.className = 'icon-btn channels-top-more-btn';
topMenuBtn.setAttribute('aria-label', 'Ещё действия');
topMenuBtn.setAttribute('aria-haspopup', 'menu');
topMenuBtn.setAttribute('aria-expanded', 'false');
topMenuBtn.title = 'Ещё действия';
topMenuBtn.append(createOverflowDots());
topMenuBtn.addEventListener('click', (event) => {
event.stopPropagation();
animatePress(topMenuBtn);
if (listState.topMenuAnchor === topMenuBtn) {
closeTopChannelsMenu(listState);
return;
}
openTopChannelsMenu({
listState,
anchorEl: topMenuBtn,