Not manipulate the visibility of the left sidebar if the left sidebar toggle btn is hidden

This commit is contained in:
Jeremy Zhang 2018-05-07 23:07:48 +00:00
parent 2feec0e597
commit 528e8584c0

View File

@ -862,13 +862,21 @@
return; return;
} }
if (animate_it) { if (animate_it) {
if ($("#guild-btn").is(":visible")) {
$("#guild-btn").sideNav("show"); $("#guild-btn").sideNav("show");
}
$("#channel-"+channel_id)[0].scrollIntoView({behavior: "smooth"}); $("#channel-"+channel_id)[0].scrollIntoView({behavior: "smooth"});
flashElement($("#channel-"+channel_id)); flashElement($("#channel-"+channel_id));
var timeout = 400;
if ($("#guild-btn").is(":visible")) {
timeout = 1000;
}
setTimeout(function () { setTimeout(function () {
if ($("#guild-btn").is(":visible")) {
$("#guild-btn").sideNav("hide"); $("#guild-btn").sideNav("hide");
}
select_channel(channel_id, false, true); select_channel(channel_id, false, true);
}, 1000); }, timeout);
return; return;
} }
selected_channel = channel_id; selected_channel = channel_id;