signal-desktop/ts/backbone/views/Lightbox.ts
2019-03-12 17:44:14 -07:00

24 lines
664 B
TypeScript

export const show = (element: HTMLElement): void => {
const container: HTMLDivElement | null = document.querySelector(
'.lightbox-container'
);
if (!container) {
throw new TypeError("'.lightbox-container' is required");
}
// tslint:disable-next-line:no-inner-html
container.innerHTML = '';
container.style.display = 'block';
container.appendChild(element);
};
export const hide = (): void => {
const container: HTMLDivElement | null = document.querySelector(
'.lightbox-container'
);
if (!container) {
return;
}
// tslint:disable-next-line:no-inner-html
container.innerHTML = '';
container.style.display = 'none';
};