changes
This commit is contained in:
@@ -141,13 +141,18 @@ function closeOnEsc(e) {
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener("keydown", closeOnEsc);
|
||||
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
||||
document.documentElement.style.cssText += ` ;padding-right: ${scrollbarWidth}px;`;
|
||||
document.documentElement.classList.add("is-clipped");
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener("keydown", closeOnEsc);
|
||||
const remaining = document.getElementsByClassName("modal-background").length;
|
||||
if (remaining === 0) document.documentElement.classList.remove("is-clipped");
|
||||
if (remaining === 0) {
|
||||
document.documentElement.classList.remove("is-clipped");
|
||||
document.documentElement.style.removeProperty("padding-right");
|
||||
}
|
||||
});
|
||||
|
||||
const loaded = ref(false);
|
||||
|
||||
Reference in New Issue
Block a user