SHA256
Обновить UI-ветку
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user