Skip to content

Commit

Permalink
No follow for Account Login header url (Shopify#3611)
Browse files Browse the repository at this point in the history
  • Loading branch information
jclarkin authored and NikoBerger committed Sep 26, 2024
1 parent 753e126 commit a0d873d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions sections/header.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,41 @@ if (dropdownItems !== null) {
});
});
}
</script>

<script>
let items = document.querySelector(".header__inline-menu").querySelectorAll("details");
let dropdownItems = document.querySelector(".header__submenu");
items.forEach(item => {
item.addEventListener("mouseenter", () => {
item.setAttribute("open", true);
let ulElement = item.querySelector("ul");
if (ulElement !== null) {
ulElement.addEventListener("mouseleave", () => {
item.removeAttribute("open");
});
}
});
item.addEventListener("focus", () => {
item.setAttribute("open", true);
});
item.addEventListener("blur", () => {
item.removeAttribute("open");
});
item.addEventListener("mouseenter", () => {
item.setAttribute("open", "");
});
item.addEventListener("mouseleave", () => {
item.removeAttribute("open");
});
});
if (dropdownItems !== null) {
dropdownItems.addEventListener("mouseleave", () => {
items.forEach(item => {
item.removeAttribute("open");
});
});
}
</script>

{%- if request.page_type == 'index' -%}
Expand Down
1 change: 1 addition & 0 deletions snippets/header-drawer.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
<a
href="{%- if customer -%}{{ routes.account_url }}{%- else -%}{{ routes.account_login_url }}{%- endif -%}"
class="menu-drawer__account link focus-inset h5 medium-hide large-up-hide"
rel="nofollow"
>
{%- if section.settings.enable_customer_avatar -%}
<account-icon>
Expand Down

0 comments on commit a0d873d

Please sign in to comment.