fix keyboard up/down browsing
This commit is contained in:
parent
246e899cd3
commit
2c1ff6fc21
7
index.js
7
index.js
|
@ -189,8 +189,7 @@ function toggleFavorite(alias) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function nextFont() {
|
function nextFont() {
|
||||||
var activeLink = document.querySelector('.entry .active');
|
var activeEntry = document.querySelector('.entry.active');
|
||||||
var activeEntry = activeLink.parentNode;
|
|
||||||
var next = activeEntry.nextSibling;
|
var next = activeEntry.nextSibling;
|
||||||
if (next && next.matches('.entry')) {
|
if (next && next.matches('.entry')) {
|
||||||
next.querySelector('a').click();
|
next.querySelector('a').click();
|
||||||
|
@ -199,8 +198,7 @@ function nextFont() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function previousFont() {
|
function previousFont() {
|
||||||
var activeLink = document.querySelector('.entry .active');
|
var activeEntry = document.querySelector('.entry.active');
|
||||||
var activeEntry = activeLink.parentNode;
|
|
||||||
var next = activeEntry.previousSibling;
|
var next = activeEntry.previousSibling;
|
||||||
if (next && next.matches('.entry')) {
|
if (next && next.matches('.entry')) {
|
||||||
next.querySelector('a').click();
|
next.querySelector('a').click();
|
||||||
|
@ -355,6 +353,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('body').on('keydown', function(event) {
|
$('body').on('keydown', function(event) {
|
||||||
|
console.log(event.target);
|
||||||
if (
|
if (
|
||||||
event.target === document.querySelector('.select-list')
|
event.target === document.querySelector('.select-list')
|
||||||
&& ! event.ctrlKey
|
&& ! event.ctrlKey
|
||||||
|
|
Loading…
Reference in New Issue