17 lines
705 B
TypeScript
17 lines
705 B
TypeScript
import ElementsUtil from './require/elements-util.js';
|
|
|
|
import Q from '../q-module.js';
|
|
import UI from '../ui.js';
|
|
import createConnectionContextMenu from './context-menu-conn';
|
|
|
|
export default function bindConnectionEvents(document: Document, q: Q, ui: UI): void {
|
|
q.$('#connection').addEventListener('click', () => {
|
|
if (ui.activeGuild === null) return;
|
|
if (!ui.activeGuild.isSocketVerified()) return;
|
|
|
|
let contextMenu = createConnectionContextMenu(document, q, ui, ui.activeGuild);
|
|
document.body.appendChild(contextMenu);
|
|
ElementsUtil.alignContextElement(contextMenu, q.$('#connection'), { bottom: 'top', centerX: 'centerX' });
|
|
});
|
|
}
|