diff --git a/CHANGELOG.md b/CHANGELOG.md index a5c2f70..141b2b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ a feature and cleanup update. effect until the release after this one). - bugfix: blue select tags are no longer purple. - bugfix: page titles now respond to small-text mode. +- bugfix: weekly calendar view height is now sized correctly according to its contents. - themes: "littlepig" (light + dark) = monospaced themes using emojis and colourful text. - extension: "font chooser" = customize fonts. for each option, type in the name of the font you would like to use, or leave it blank to not change anything. diff --git a/mods/weekly-view/mod.js b/mods/weekly-view/mod.js index 17437a5..2e66179 100644 --- a/mods/weekly-view/mod.js +++ b/mods/weekly-view/mod.js @@ -12,7 +12,7 @@ module.exports = { tags: ['extension'], name: 'weekly view', desc: 'calendar views named "weekly" will show only the 7 days of this week.', - version: '0.5.0', + version: '0.5.1', author: 'adihd', hacks: { 'renderer/preload.js'(store, __exports) { @@ -36,15 +36,17 @@ module.exports = { if (!collection_view || collection_view.innerText != 'weekly') return; const days = collection_view.parentElement.parentElement.parentElement.parentElement.getElementsByClassName( - 'notion-calendar-view-day' - ); + 'notion-calendar-view-day' + ), + today = [...days].find((day) => day.style.background), + height = today + ? getComputedStyle( + today.parentElement.parentElement + ).getPropertyValue('height') + : 0; for (let day of days) day.parentElement.parentElement.style.height = 0; - if (days.length) { - const today = [...days].find((day) => day.style.background); - if (today) - today.parentElement.parentElement.style.height = '124px'; - } + today.parentElement.parentElement.style.height = height; } } });