mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-05 12:22:28 +00:00
Improve zap popover toggles
This commit is contained in:
1 parent
d1ea1a316c
commit
fa67cbc5dc
2 files changed
+20
-4
No files matched your search
@@ -408,14 +408,22 @@ export class VideoModal {
|
||||
if (this.modalZapBtn) {
|
||||
this.modalZapBtn.addEventListener("click", (event) => {
|
||||
event?.preventDefault?.();
|
||||
event?.stopPropagation?.();
|
||||
|
||||
if (this.modalZapBtn?.disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isExpanded =
|
||||
this.modalZapBtn.getAttribute("aria-expanded") === "true";
|
||||
const popoverIsOpen =
|
||||
typeof this.modalZapPopover?.isOpen === "function"
|
||||
? this.modalZapPopover.isOpen()
|
||||
: this.modalZapDialogOpen === true;
|
||||
|
||||
if (popoverIsOpen) {
|
||||
if (this.modalZapPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isExpanded) {
|
||||
this.closeZapDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user