Merge pull request #2259 from thelounge/xpaw/keybind-scroll

Scroll channel list only when using keybinds
This commit is contained in:
Jérémie Astori 2018-03-20 19:40:14 -04:00 committed by GitHub
commit bb4740ba76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -3,6 +3,7 @@
const $ = require("jquery"); const $ = require("jquery");
const Mousetrap = require("mousetrap"); const Mousetrap = require("mousetrap");
const wrapCursor = require("undate").wrapCursor; const wrapCursor = require("undate").wrapCursor;
const utils = require("./utils");
const input = $("#input"); const input = $("#input");
const sidebar = $("#sidebar"); const sidebar = $("#sidebar");
const windows = $("#windows"); const windows = $("#windows");
@ -54,7 +55,8 @@ Mousetrap.bind([
break; break;
} }
channels.eq(target).click(); target = channels.eq(target).click();
utils.scrollIntoViewNicely(target[0]);
return false; return false;
}); });
@ -88,7 +90,8 @@ Mousetrap.bind([
break; break;
} }
lobbies.eq(target).click(); target = lobbies.eq(target).click();
utils.scrollIntoViewNicely(target[0]);
return false; return false;
}); });

View File

@ -378,8 +378,6 @@ $(function() {
utils.toggleNotificationMarkers(false); utils.toggleNotificationMarkers(false);
} }
utils.scrollIntoViewNicely(self[0]);
if ($(window).outerWidth() < utils.mobileViewportPixels) { if ($(window).outerWidth() < utils.mobileViewportPixels) {
slideoutMenu.toggle(false); slideoutMenu.toggle(false);
} }