mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-07 22:19:02 +00:00
#101 weekly calendar view even if not first on page
This commit is contained in:
parent
21b3802e08
commit
677fd3cf10
@ -13,6 +13,7 @@
|
|||||||
- bugfix: block indents are no longer overriden.
|
- bugfix: block indents are no longer overriden.
|
||||||
- bugfix: neutral does not force full width pages.
|
- bugfix: neutral does not force full width pages.
|
||||||
- bugfix: bypass preview extension works with the back/forward arrows.
|
- bugfix: bypass preview extension works with the back/forward arrows.
|
||||||
|
- bugfix: check all views on a page for a weekly calendar.
|
||||||
|
|
||||||
### v0.9.0 (2020-09-20)
|
### v0.9.0 (2020-09-20)
|
||||||
|
|
||||||
|
@ -30,23 +30,24 @@ module.exports = {
|
|||||||
subtree: true,
|
subtree: true,
|
||||||
});
|
});
|
||||||
function process(list, observer) {
|
function process(list, observer) {
|
||||||
const collection_view = document.querySelector(
|
document
|
||||||
'.notion-collection-view-select'
|
.querySelectorAll('.notion-collection-view-select')
|
||||||
);
|
.forEach((collection_view) => {
|
||||||
if (!collection_view || collection_view.innerText != 'weekly')
|
if (collection_view.innerText != 'weekly') return;
|
||||||
return;
|
const days = collection_view.parentElement.parentElement.parentElement.parentElement.getElementsByClassName(
|
||||||
const days = collection_view.parentElement.parentElement.parentElement.parentElement.getElementsByClassName(
|
'notion-calendar-view-day'
|
||||||
'notion-calendar-view-day'
|
),
|
||||||
),
|
today = [...days].find((day) => day.style.background),
|
||||||
today = [...days].find((day) => day.style.background),
|
height = today
|
||||||
height = today
|
? getComputedStyle(
|
||||||
? getComputedStyle(
|
today.parentElement.parentElement
|
||||||
today.parentElement.parentElement
|
).getPropertyValue('height')
|
||||||
).getPropertyValue('height')
|
: 0;
|
||||||
: 0;
|
for (let day of days)
|
||||||
for (let day of days)
|
day.parentElement.parentElement.style.height = 0;
|
||||||
day.parentElement.parentElement.style.height = 0;
|
if (today)
|
||||||
if (today) today.parentElement.parentElement.style.height = height;
|
today.parentElement.parentElement.style.height = height;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user