Compare commits

...

2 Commits

Author SHA1 Message Date
51e4189dc9 Merge pull request 'Fix: Multiple JavaScript errors on Settings page' (#68) from fix/setting-page-errors into main
Some checks failed
DevStar Studio CI/CD Pipeline / DevStarStudio-CICD-Pipeline (push) Failing after 35m59s
Reviewed-on: #68
2026-01-12 07:25:15 +00:00
8115eb4b6f Fix: Multiple JavaScript errors on Settings page
Some checks failed
DevStar Studio CI/CD Pipeline / DevStarStudio-CICD-Pipeline (pull_request) Failing after 39m44s
2026-01-12 12:43:00 +08:00
2 changed files with 8 additions and 1 deletions

View File

@@ -1,4 +1,3 @@
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}}
<!-- 自定义logo upload -->
<h4 class="ui top attached header">
{{ctx.Locale.Tr "admin.config.app_logo_config"}}

View File

@@ -11,6 +11,14 @@ import {initFomanticTab} from './fomantic/tab.ts';
export const fomanticMobileScreen = window.matchMedia('only screen and (max-width: 767.98px)');
export function initGiteaFomantic() {
// Guard against race conditions where fomantic.js hasn't been fully initialized yet.
// This can happen on pages like Settings when document.readyState is already 'interactive'
// or 'complete' when index.js executes, causing onDomReady to fire immediately.
if (!$.fn.dropdown || !$.fn.dropdown.settings) {
console.warn('Fomantic UI dropdown not initialized yet, skipping initGiteaFomantic');
return;
}
// our extensions
$.fn.fomanticExt = {};
// By default, use "exact match" for full text search