From f507a1a1d93210c16a9a4cfa5b6d253b73b0f7b6 Mon Sep 17 00:00:00 2001 From: Rohitt Vashishtha Date: Thu, 11 Jul 2019 00:47:49 +0530 Subject: [PATCH] portico: Remove scroll-to attribute support. This feature was added in 3b55519b1183d05579dc6ec63d7dedfaf66a6977 without any uses of it in the markup, and we do not appear to use scroll-to anywhere in our portico pages. --- static/js/portico/landing-page.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/static/js/portico/landing-page.js b/static/js/portico/landing-page.js index 9e0ee54a60..820fe70c27 100644 --- a/static/js/portico/landing-page.js +++ b/static/js/portico/landing-page.js @@ -6,24 +6,6 @@ const ELECTRON_APP_URL_WINDOWS = "https://github.com/zulip/zulip-desktop/release import render_tabs from './team.js'; import {detect_user_os} from './tabbed-instructions.js'; -// this will either smooth scroll to an anchor where the `name` -// is the same as the `scroll-to` reference, or to a px height -// (as specified like `scroll-to='0px'`). -var ScrollTo = function () { - $("[scroll-to]").click(function () { - var sel = $(this).attr("scroll-to"); - - // if the `scroll-to` is a parse-able pixel value like `50px`, - // then use that as the scrollTop, else assume it is a selector name - // and find the `offsetTop`. - var top = /\dpx/.test(sel) ? - parseInt(sel, 10) : - $("[name='" + sel + "']").offset().top; - - $("body").animate({ scrollTop: top + "px" }, 300); - }); -}; - export function path_parts() { return window.location.pathname.split('/').filter(function (chunk) { return chunk !== ''; @@ -152,8 +134,6 @@ var apps_events = function () { }; var events = function () { - ScrollTo(); - // get the location url like `zulipchat.com/features/`, cut off the trailing // `/` and then split by `/` to get ["zulipchat.com", "features"], then // pop the last element to get the current section (eg. `features`).