Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mouseover event for page titles to show day name #82

Merged
merged 10 commits into from
Jun 17, 2020
Prev Previous commit
Next Next commit
Updated function to use ?. operator
  • Loading branch information
braydie committed Jun 17, 2020
commit c01fd20bc5559b251ce453fd1a3cb56f0e1914b9
9 changes: 2 additions & 7 deletions src/ts/core/features/day-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ function getDayFromDate(name: string) {
return null
}

function isPageViewTitle(element: HTMLElement) {
return (
element.parentNode &&
element.parentNode.parentNode &&
(element.parentNode.parentNode as Element).classList.contains('rm-ref-page-view-title')
)
}
const isElementPageViewTitle = (element: HTMLElement) =>
(element.parentNode?.parentNode as HTMLElement)?.classList?.contains('rm-ref-page-view-title')

document.querySelector('body')?.addEventListener('mouseover', ev => {
const target = ev.target as HTMLElement
Expand Down