mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
Simplify class application for open modals.
This commit is contained in:
parent
95b32937d6
commit
4bfc2c3810
2 changed files with 2 additions and 10 deletions
|
@ -96,11 +96,7 @@
|
||||||
dispatch("open");
|
dispatch("open");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($modalsOpen.length > 0) {
|
document.body.classList.toggle("bx--body--with-modal-open", $modalsOpen.length > 0);
|
||||||
document.body.classList.add("bx--body--with-modal-open");
|
|
||||||
} else {
|
|
||||||
document.body.classList.remove("bx--body--with-modal-open");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$: if (open) {
|
$: if (open) {
|
||||||
|
|
|
@ -126,11 +126,7 @@
|
||||||
dispatch("open");
|
dispatch("open");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($modalsOpen.length > 0) {
|
document.body.classList.toggle("bx--body--with-modal-open", $modalsOpen.length > 0);
|
||||||
document.body.classList.add("bx--body--with-modal-open");
|
|
||||||
} else {
|
|
||||||
document.body.classList.remove("bx--body--with-modal-open");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$: modalLabelId = `bx--modal-header__label--modal-${id}`;
|
$: modalLabelId = `bx--modal-header__label--modal-${id}`;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue