mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 09:03:57 +00:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user