Skip to content

Commit

Permalink
Corrects calendar popup click away listener to allow for previous and…
Browse files Browse the repository at this point in the history
… next links to perform

Signed-off-by: Aaron Stephanus <[email protected]>
  • Loading branch information
Aaron Stephanus committed Dec 28, 2023
1 parent e5370ac commit 9a3a0e6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions _layouts/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@
<div class="events--calendar--head--prev-next">
<div class="events--calendar--head--prev-next--prev">
{% if page.previous %}
<a href="{{ page.previous.url }}">&lt;&nbsp;Previous</a>
<a class="events--calendar--head--prev-next--anchor" href="{{ page.previous.url }}">&lt;&nbsp;Previous</a>
{% else %}
<span>Previous</span>
{% endif %}
</div>
<div class="events--calendar--head--prev-next--next">
{% if page.next %}
<a href="{{ page.next.url }}">Next&nbsp;&gt;</a>
<a class="events--calendar--head--prev-next--anchor" href="{{ page.next.url }}">Next&nbsp;&gt;</a>
{% else %}
<span>Next&nbsp;&gt;</span>
{% endif %}
Expand Down Expand Up @@ -556,8 +556,11 @@ <h2 class="platform-page--solution--header">Connect with the community</h2>
const clickWasInsideCard = detailsCard !== null;
if (!clickWasInsideCard) {
hideEventDetails(currentlyVisibleDetails);
const eventNameLinkClassName = 'events--calendar--body--week--day--event--name--anchor';
if (!e.target.classList.contains(eventNameLinkClassName)) {
const allowableAnchorClassNames = [
'events--calendar--head--prev-next--anchor',
'events--calendar--body--week--day--event--name--anchor',
];
if (!allowableAnchorClassNames.some(className => e.target.classList.contains(className))) {
// If an event name was NOT clicked then prevent the default action.
// Otherwise allow the navigation to the clicked event to be performed.
event.preventDefault();
Expand Down

0 comments on commit 9a3a0e6

Please sign in to comment.