Ignore arrow key navigation when modifier keys held

This commit is contained in:
im-mi 2016-08-31 18:08:24 -04:00
parent d9485bbb40
commit 891e52f4b9

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}'; }
});