SHA256
CORE/CONTENT test5593 и адаптация UI
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { t } from '../i18n/index.js';
|
||||
import { createDropdownMenu } from './dropdown-menu.js';
|
||||
import { iconHtml } from './ui-icon.js';
|
||||
|
||||
export function attachMessageMenu(card, head, items) {
|
||||
const trigger = document.createElement('button');
|
||||
trigger.type = 'button';
|
||||
trigger.className = 'icon-btn channel-message-more';
|
||||
trigger.innerHTML = iconHtml('more');
|
||||
trigger.setAttribute('aria-label', t('screens.message_menu.text_001'));
|
||||
head.append(trigger);
|
||||
const menu = createDropdownMenu({ anchorEl: trigger, items });
|
||||
const previousCleanup = card.cleanup;
|
||||
card.cleanup = () => {
|
||||
previousCleanup?.();
|
||||
menu.destroy();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user