Simplify class application for open modals.

This commit is contained in:
Harald Brunner 2022-06-06 19:21:08 +02:00
commit 4bfc2c3810
2 changed files with 2 additions and 10 deletions

View file

@ -96,11 +96,7 @@
dispatch("open");
}
if ($modalsOpen.length > 0) {
document.body.classList.add("bx--body--with-modal-open");
} else {
document.body.classList.remove("bx--body--with-modal-open");
}
document.body.classList.toggle("bx--body--with-modal-open", $modalsOpen.length > 0);
});
$: if (open) {

View file

@ -126,11 +126,7 @@
dispatch("open");
}
if ($modalsOpen.length > 0) {
document.body.classList.add("bx--body--with-modal-open");
} else {
document.body.classList.remove("bx--body--with-modal-open");
}
document.body.classList.toggle("bx--body--with-modal-open", $modalsOpen.length > 0);
});
$: modalLabelId = `bx--modal-header__label--modal-${id}`;