From 7d27090d1db7a230e313f51684e82d112b4f6047 Mon Sep 17 00:00:00 2001 From: lng2020 Date: Tue, 26 Sep 2023 17:31:16 +0800 Subject: [PATCH 1/2] fix user labels are invisible --- web_src/js/modules/fomantic.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_src/js/modules/fomantic.js b/web_src/js/modules/fomantic.js index 3d4a66c1ea9dd..d29ff6722e246 100644 --- a/web_src/js/modules/fomantic.js +++ b/web_src/js/modules/fomantic.js @@ -35,9 +35,10 @@ export function initGiteaFomantic() { const isIn = arg?.animation?.endsWith(' in'); const isOut = arg?.animation?.endsWith(' out'); + const isScale = arg?.animation?.includes('scale'); let ret; - if (arg === 'show' || isIn) { + if (arg === 'show' || isIn || isScale) { arg?.onStart?.(this); ret = this.each((_, el) => { el.classList.remove('hidden'); From 4ac79aba69a72d241e44153d754e81bea25388fc Mon Sep 17 00:00:00 2001 From: lng2020 Date: Tue, 26 Sep 2023 19:13:21 +0800 Subject: [PATCH 2/2] fix --- web_src/js/modules/fomantic.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/web_src/js/modules/fomantic.js b/web_src/js/modules/fomantic.js index d29ff6722e246..17d6a0af35d35 100644 --- a/web_src/js/modules/fomantic.js +++ b/web_src/js/modules/fomantic.js @@ -38,7 +38,7 @@ export function initGiteaFomantic() { const isScale = arg?.animation?.includes('scale'); let ret; - if (arg === 'show' || isIn || isScale) { + if (arg === 'show' || isIn) { arg?.onStart?.(this); ret = this.each((_, el) => { el.classList.remove('hidden'); @@ -58,8 +58,22 @@ export function initGiteaFomantic() { arg?.onHidden?.(this); }); arg?.onComplete?.(this); + } else if (isScale) { + arg?.onStart?.(this); + ret = this.each((_, el) => { + if (el.classList.contains('hidden')) { + el.classList.remove('hidden'); + el.classList.add('visible'); + arg?.onShow?.(this); + } else if (el.classList.contains('visible')) { + el.classList.remove('visible'); + el.classList.add('hidden'); + el.style.removeProperty('display'); + arg?.onHidden?.(this); + } + }); + arg.onComplete?.(this); } - return ret; };