Today button lines up today's day number at the top

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-09 20:44:32 -05:00
1 parent e5ba9faae3
commit f8701885c5
1 file changed
+5 -1
+5 -1
View File
@@ -26,9 +26,13 @@ document.addEventListener('DOMContentLoaded', function() {
(function() {
window.scrollToToday = function() {
// Line up today's day number near the top of the window. Centering the whole cell hid the number
// above the window when the day is busy (tall cell).
const todayElement = document.getElementById('today');
if (todayElement) {
todayElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
const target = todayElement.querySelector('.day-num') || todayElement;
const top = target.getBoundingClientRect().top + window.scrollY - 10;
window.scrollTo({ top: Math.max(top, 0), behavior: 'smooth' });
}
};