From 17ded0a3bd32c7520c3a40f1ee8f8b14bfefca2e Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Wed, 1 Nov 2017 06:43:12 +0000 Subject: [PATCH] Scroll sidebar in case if the channel is not in view --- webapp/titanembeds/static/js/embed.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index 3a77570..c77894c 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -663,6 +663,9 @@ 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"); + } flashElement($("#channel-"+channel_id)); setTimeout(function () { $("#guild-btn").sideNav("hide");