Limit modal height to prevent overflow on short screens

This commit is contained in:
SpectralFlame 2022-09-27 22:36:08 -05:00 committed by cyip92
parent e8126af5d7
commit 7c51d799dc
2 changed files with 19 additions and 3 deletions

View File

@ -6835,10 +6835,8 @@ kbd {
.c-enslaved-hint-modal {
display: flex;
overflow-y: scroll;
flex-direction: column;
width: 60rem;
height: 57rem;
text-align: left;
font-size: 1.2rem;
padding: 0.25rem 1rem;

View File

@ -9,11 +9,22 @@ export default {
},
data() {
return {
limitSize: false,
forceDontShowModal: false
};
},
computed: {
classObject() {
return {
"c-modal l-modal": true,
"c-limit-size": this.limitSize,
};
}
},
created() {
this.on$(GAME_EVENT.CLOSE_MODAL, this.hide);
// The H2P modal scales dynamically to screen size and limiting it here can cause a double-scrollbar to appear
this.limitSize = this.modal._component.name !== "H2PModal";
},
destroyed() {
document.activeElement.blur();
@ -35,7 +46,7 @@ export default {
<template>
<div
v-if="!forceDontShowModal"
class="c-modal l-modal"
:class="classObject"
>
<component
:is="modal.component"
@ -44,3 +55,10 @@ export default {
/>
</div>
</template>
<style scoped>
.c-limit-size {
max-height: 65rem;
overflow-y: scroll;
}
</style>