cordis/client/webapp/elements/events-connection.ts
2021-11-07 15:57:09 -06:00

17 lines
700 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.activeServer === null) return;
if (!ui.activeServer.isVerified) return;
let contextMenu = createConnectionContextMenu(document, q, ui, ui.activeServer);
document.body.appendChild(contextMenu);
ElementsUtil.alignContextElement(contextMenu, q.$('#connection'), { bottom: 'top', centerX: 'centerX' });
});
}