diff --git a/Events.php b/Events.php index f50ed3c..b024aa7 100644 --- a/Events.php +++ b/Events.php @@ -3,6 +3,7 @@ namespace humhub\modules\kickoff; use humhub\modules\kickoff\adapters\ManualAdapter; +use humhub\modules\kickoff\assets\Assets; use humhub\modules\kickoff\models\Competition; use humhub\modules\kickoff\services\KickoffTime; use humhub\modules\kickoff\services\MatchdayBonusService; @@ -16,6 +17,16 @@ class Events { + /** + * Loads the Kickoff stylesheet (~8 KB, cached) on every full page load, + * so Pjax navigation never swaps in Kickoff content before its styles + * are available (brief unstyled flash, most visible in Firefox). + */ + public static function onLayoutAddonsBeforeRun($event): void + { + $event->sender->view->registerAssetBundle(Assets::class); + } + public static function onTopMenuInit($event): void { try { diff --git a/config.php b/config.php index 69a1a5f..0a64946 100644 --- a/config.php +++ b/config.php @@ -3,6 +3,7 @@ use humhub\commands\CronController; use humhub\modules\admin\widgets\AdminMenu; use humhub\modules\kickoff\Events; +use humhub\widgets\LayoutAddons; use humhub\widgets\TopMenu; return [ @@ -10,6 +11,7 @@ 'class' => 'humhub\modules\kickoff\Module', 'namespace' => 'humhub\modules\kickoff', 'events' => [ + ['class' => LayoutAddons::class, 'event' => LayoutAddons::EVENT_BEFORE_RUN, 'callback' => [Events::class, 'onLayoutAddonsBeforeRun']], ['class' => TopMenu::class, 'event' => TopMenu::EVENT_INIT, 'callback' => [Events::class, 'onTopMenuInit']], ['class' => AdminMenu::class, 'event' => AdminMenu::EVENT_INIT, 'callback' => [Events::class, 'onAdminMenuInit']], ['class' => CronController::class, 'event' => CronController::EVENT_ON_HOURLY_RUN, 'callback' => [Events::class, 'onCronHourly']], diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 22cf2cc..1d6cd9b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -12,6 +12,8 @@ Changelog - Enh: The competition admin view gains a "Teams" page listing all participating teams with their national flag, name and group. - Enh: Leaderboards now show a count for every scoring tier — a new "Tendency" column alongside Exact and Goal diff — with clearer headings (Total / Exact / Goal diff / Tendency) and explanatory tooltips. Ties are now broken by total points, then exact-score hits, then correct goal differences, then correct tendencies. - Fix: England no longer displays as "United Kingdom" with the Union Jack — England, Scotland and Wales now use their own flags (Unicode subdivision tag sequences) with their proper names; Kosovo (KVX) resolves to its localized name and flag; Northern Ireland falls back to a neutral initials badge (it has no emoji flag). +- Fix: Team flag/logo images no longer flash at full content width while the page stylesheet is loading (visible in Firefox) — badge images now carry explicit dimensions. +- Fix: Kickoff pages no longer show briefly unstyled when navigated to in-app (Pjax swaps content in before the page's stylesheet has loaded) — the small Kickoff stylesheet now loads with every full page load via a layout addon. 1.0.4 (June 3,2026) ------------------- diff --git a/views/competition/_team_badge.php b/views/competition/_team_badge.php index 6b514b1..467a38e 100644 --- a/views/competition/_team_badge.php +++ b/views/competition/_team_badge.php @@ -44,13 +44,17 @@ $color = $team ? $palette[$team->id % count($palette)] : '#9ca3af'; ?> + - <?= Html::encode($name) ?> + <?= Html::encode($name) ?> - <?= Html::encode($name) ?> + <?= Html::encode($name) ?>