Merge pull request #588 from im-mi/arrow-key-nav-ignore-modifiers

Ignore arrow key navigation when modifier keys held
This commit is contained in:
Shish 2016-09-26 15:22:06 -05:00 committed by GitHub
commit 3daa83223e

View File

@ -47,6 +47,7 @@ class ArrowkeyNavigation extends Extension {
(function($){
$(document).keyup(function(e) {
if($(e.target).is('input', 'textarea')){ return; }
if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) { return; }
if (e.keyCode == 37) { window.location.href = '{$prev_url}'; }
else if (e.keyCode == 39) { window.location.href = '{$next_url}'; }
});