Use scroll into view instead

This commit is contained in:
Jeremy Zhang 2017-11-01 17:30:47 +00:00
parent 17ded0a3bd
commit a2b2cce815

View File

@ -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");