Skip to content

Commit

Permalink
SHS-5504: Prevent JS error when link is absent in vertical linked car…
Browse files Browse the repository at this point in the history
…ds (#1471)

* fix(shs-5504): prevent error when link is absent in vertical linked cards

* chore(shs-5504): add prettier config to match eslint
  • Loading branch information
cienvaras authored Mar 6, 2024
1 parent 4ef52a6 commit 6fe33f7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docroot/themes/humsci/humsci_basic/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ function verticalLinkedCard() {
// Loop through each card
cards.forEach((card) => {
// Find the main link within each card
const mainLink = card.querySelector('.hb-vertical-linked-card__title__link');
const mainLink = card.querySelector(
'.hb-vertical-linked-card__title__link',
);

if (!mainLink) {
return;
}

// Add a click event listener to each card
function handleClick() {
Expand Down
Loading

0 comments on commit 6fe33f7

Please sign in to comment.