2018-04-15 00:33:35 -04:00
|
|
|
export const show = (element: HTMLElement): void => {
|
|
|
|
const container: HTMLDivElement | null = document.querySelector(
|
2018-04-24 12:06:43 -04:00
|
|
|
'.lightbox-container'
|
2018-04-15 00:33:35 -04:00
|
|
|
);
|
2019-01-14 13:49:58 -08:00
|
|
|
if (!container) {
|
2018-04-24 12:06:43 -04:00
|
|
|
throw new TypeError("'.lightbox-container' is required");
|
2018-04-15 00:33:35 -04:00
|
|
|
}
|
2018-05-22 12:31:43 -07:00
|
|
|
// tslint:disable-next-line:no-inner-html
|
2018-04-15 00:33:35 -04:00
|
|
|
container.innerHTML = '';
|
|
|
|
container.style.display = 'block';
|
|
|
|
container.appendChild(element);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const hide = (): void => {
|
|
|
|
const container: HTMLDivElement | null = document.querySelector(
|
2018-04-24 12:06:43 -04:00
|
|
|
'.lightbox-container'
|
2018-04-15 00:33:35 -04:00
|
|
|
);
|
2019-01-14 13:49:58 -08:00
|
|
|
if (!container) {
|
2018-04-15 00:33:35 -04:00
|
|
|
return;
|
|
|
|
}
|
2018-05-22 12:31:43 -07:00
|
|
|
// tslint:disable-next-line:no-inner-html
|
2018-04-15 00:33:35 -04:00
|
|
|
container.innerHTML = '';
|
|
|
|
container.style.display = 'none';
|
|
|
|
};
|