From aa393fff9011b14dbde7458eb6919e65a7d68b3d Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Fri, 3 Jan 2025 07:27:21 +0100 Subject: [PATCH 1/3] set scrollable area height when remote images are loaded --- assets/js/widgets/suggested-tasks.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/assets/js/widgets/suggested-tasks.js b/assets/js/widgets/suggested-tasks.js index 98a8cc15e..1f7d85cf5 100644 --- a/assets/js/widgets/suggested-tasks.js +++ b/assets/js/widgets/suggested-tasks.js @@ -299,8 +299,18 @@ class BadgeScroller { init() { this.addEventListeners(); - // On page load. - this.setWrapperHeight(); + // On page load, when all images are loaded. + const images = [ ...this.element.querySelectorAll( 'img' ) ]; + if ( images.length ) { + Promise.all( + images.map( + ( im ) => + new Promise( ( resolve ) => ( im.onload = resolve ) ) + ) + ).then( () => { + this.setWrapperHeight(); + } ); + } // When popover is opened. document From e7770679c2b48253962cb50a16cd569351685375 Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Fri, 3 Jan 2025 07:27:43 +0100 Subject: [PATCH 2/3] fix new year badges --- classes/badges/class-monthly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/badges/class-monthly.php b/classes/badges/class-monthly.php index 85092b6ef..06a0af062 100644 --- a/classes/badges/class-monthly.php +++ b/classes/badges/class-monthly.php @@ -57,7 +57,7 @@ public static function init_badges() { $start_date = $activation_date->modify( 'first day of this month' ); // Year when plugin was released. - $end_date = ( 2024 === (int) $start_date->format( 'Y' ) ) + $end_date = ( 2024 === (int) $start_date->format( 'Y' ) && 2024 === (int) \gmdate( 'Y' ) ) ? new \DateTime( 'last day of December next year' ) : new \DateTime( 'last day of December this year' ); From 1ab1fc13f0f7fa4d21e2d2258f47035cf3a3ef67 Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Fri, 3 Jan 2025 07:45:51 +0100 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 932259d51..1aecceb95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ Fixed: * Duplicate weekly suggested tasks. -* Fixed the REST API endpoint for getting stats. +* The REST API endpoint for getting stats. +* Scrollable monthly badges widget height on page load. +* 2026 monthly badges showing up = 1.0.1 =