add hotkey navigationf or posts/pools

This commit is contained in:
albert
2013-02-25 10:13:01 -05:00
parent 10b6dcebd0
commit 436c9af9da
6 changed files with 74 additions and 19 deletions

View File

@@ -2,7 +2,6 @@
Danbooru.Paginator = {};
Danbooru.Paginator.next_page = function() {
console.log("next");
if ($('.paginator li span').parent().next().length) {
window.location = $('.paginator li span').parent().next().find('a').attr('href');
}
@@ -16,7 +15,9 @@
})();
$(function() {
$(document).bind("keydown.right", Danbooru.Paginator.next_page);
$(document).bind("keydown.left", Danbooru.Paginator.prev_page);
if ($(".paginator").length) {
$(document).bind("keydown.right", Danbooru.Paginator.next_page);
$(document).bind("keydown.left", Danbooru.Paginator.prev_page);
}
});