Add settings sliders

This commit is contained in:
Andras Schmelczer 2023-05-27 15:00:04 +01:00
commit 752e1ae425
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
9 changed files with 170 additions and 48 deletions

View file

@ -6,20 +6,14 @@ export class CollapsiblePanelAnimator {
public constructor(
infoButton: HTMLButtonElement,
private readonly infoPage: HTMLElement
private readonly infoPage: HTMLElement,
ignoreForCloseOnClick: HTMLElement
) {
infoButton.addEventListener('click', this.toggle.bind(this));
window.addEventListener('click', (event) => {
if ([infoButton, this.infoPage].includes(event.target as HTMLElement)) {
return;
}
if (this.infoPage.contains(event.target as Node)) {
return;
}
this.close();
});
window.addEventListener(
'click',
(event) => !ignoreForCloseOnClick.contains(event.target as Node) && this.close()
);
}
public open() {