mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-26 21:28:40 +00:00
25 lines
664 B
TypeScript
25 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';
|
|
};
|