portico: Scroll to top when clicking logo on home page.

Previously, clicking the logo always triggered a full page reload,
even if the user was already on the home page. This commit adds logic
to intercept the click and smoothly scroll to the top instead,
avoiding an unnecessary reload.

Fixes #35422.

Co-authored-by: Rakshit Chauhan <rxkshit04@users.noreply.github.com>
This commit is contained in:
Rakshit Chauhan
2025-09-17 00:26:26 +05:30
committed by GitHub
parent 14c51bd0ec
commit 35ed477b32

View File

@@ -242,6 +242,13 @@ $(document).on("click", ".markdown h1, .markdown h2, .markdown h3", function ()
window.location.hash = $(this).attr("id")!;
});
$(document).on("click", ".nav-zulip-logo", (e) => {
if (document.querySelector(".portico-hello-page")) {
e.preventDefault();
window.scrollTo({top: 0, behavior: "smooth"});
}
});
$(document).on("click", ".pricing-tab", function () {
const id = $(this).attr("id")!;
const $pricing_wrapper = $(".portico-pricing");