From e314c9e86656333e9ec956f0d825ef920f491de6 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 14 Feb 2023 21:04:22 +0800 Subject: [PATCH] Fix the full-height problem for all pages (#22905) Really fix #22883, close #22901 I made a mistake that the global styles in RepoActionView.vue could still pollute global styles (I forgot that the code of this component is still loaded on every page, instead of loaded on demand) This PR makes a complete fix: only change the page's full-height behavior if the component is used. Screenshot after the fix:
![image](https://user-images.githubusercontent.com/2114189/218664776-0dbcd469-2c36-4e17-972f-e44fa3b81ba6.png)
Co-authored-by: Lunny Xiao --- web_src/js/components/RepoActionView.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web_src/js/components/RepoActionView.vue b/web_src/js/components/RepoActionView.vue index deb071da5..e0ec48893 100644 --- a/web_src/js/components/RepoActionView.vue +++ b/web_src/js/components/RepoActionView.vue @@ -268,6 +268,11 @@ export function initRepositoryActionView() { const el = document.getElementById('repo-action-view'); if (!el) return; + // TODO: the parent element's full height doesn't work well now, + // but we can not pollute the global style at the moment, only fix the height problem for pages with this component + const parentFullHeight = document.querySelector('body > div.full.height'); + if (parentFullHeight) parentFullHeight.style.paddingBottom = '0'; + const view = createApp(sfc, { runIndex: el.getAttribute('data-run-index'), jobIndex: el.getAttribute('data-job-index'), @@ -412,11 +417,6 @@ export function initRepositoryActionView() {