From a2b2cce815244493a82dd4e7a01ee3f9f96b2720 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Wed, 1 Nov 2017 17:30:47 +0000 Subject: [PATCH] Use scroll into view instead --- webapp/titanembeds/static/js/embed.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index c77894c..d441cfa 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -663,9 +663,7 @@ if (selected_channel != channel_id && guild_channels[channel_id] && guild_channels[channel_id].read) { if (animate_it) { $("#guild-btn").sideNav("show"); - if (!element_in_view($("#channel-"+channel_id), true)) { - $("#guild-nav").animate({ scrollTop: $(document).height() }, "fast"); - } + $("#channel-"+channel_id)[0].scrollIntoView({behavior: "smooth"}); flashElement($("#channel-"+channel_id)); setTimeout(function () { $("#guild-btn").sideNav("hide");