diff --git a/resources/assets/stylesheets/scss/index.scss b/resources/assets/stylesheets/scss/index.scss index c698014223b126a6aaad199d541ee90488620e75..b33d5f6f9b8cc5e17edacddcc670acc941766e77 100644 --- a/resources/assets/stylesheets/scss/index.scss +++ b/resources/assets/stylesheets/scss/index.scss @@ -122,6 +122,7 @@ $gap-between-boxes: calc($login-page-margin / 2); #login-faq-content-wrapper { height: calc(100% - 32px); + max-height: 430px; } .login-box-header { diff --git a/templates/loginform.php b/templates/loginform.php index ef831d98cda5bac5f9d2d0e64b93db310dca358c..ec2289956f5573ddaad74e0fbdea851d95437d69 100644 --- a/templates/loginform.php +++ b/templates/loginform.php @@ -137,6 +137,28 @@ $enable_news = Config::get()->LOGIN_NEWS_VISIBILITY && count($news_entries) > 0; }); // --> + <? if ($enable_faq) : ?> + STUDIP.domReady(() => { + const loginBox = document.getElementById('loginbox'); + const faqContent = document.getElementById('login-faq-content-wrapper'); + const htmlTag = document.documentElement; + + const adjustFaqHeight = () => { + if (!htmlTag.classList.contains('responsive-display')) { + const loginBoxHeight = loginBox.offsetHeight; + + const maxAllowedHeight = loginBoxHeight - 100; + + faqContent.style.maxHeight = `${Math.max(maxAllowedHeight, 0)}px`; + } + }; + + adjustFaqHeight(); + + window.addEventListener('resize', adjustFaqHeight); + }); + <? endif ?> + <? if ($enable_faq && $enable_news): ?> const faqButton = document.getElementById('show-faq'); const newsButton = document.getElementById('hide-faq');