diff options
Diffstat (limited to 'js/gui/KeyboardShortcuts.js')
-rw-r--r-- | js/gui/KeyboardShortcuts.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/js/gui/KeyboardShortcuts.js b/js/gui/KeyboardShortcuts.js index 1ea9d21d8..d818a4ded 100644 --- a/js/gui/KeyboardShortcuts.js +++ b/js/gui/KeyboardShortcuts.js @@ -34,6 +34,20 @@ ); }; + var reloadFeed = function (navigationArea) { + navigationArea.find('.active > a:visible').trigger('click'); + }; + + var nextFeed = function (navigationArea) { + navigationArea.find('.active') + .next('li').children('a:visible').trigger('click'); + }; + + var previousFeed = function (navigationArea) { + navigationArea.find('.active').prev('li') + .children('a:visible').trigger('click'); + }; + var onActiveItem = function (scrollArea, callback) { var items = scrollArea.find('.item'); @@ -147,6 +161,7 @@ if (noInputFocused($(':focus')) && noModifierKey(event)) { var keyCode = event.keyCode; var scrollArea = $('#app-content'); + var navigationArea = $('#app-navigation'); var isCompactMode = $('#app-content-wrapper > .compact').length > 0; // j, n, right arrow @@ -192,6 +207,24 @@ event.preventDefault(); openLink(scrollArea); + // r + } else if ([82].indexOf(keyCode) >= 0) { + + event.preventDefault(); + reloadFeed(navigationArea); + + // f + } else if ([70].indexOf(keyCode) >= 0) { + + event.preventDefault(); + nextFeed(navigationArea); + + // d + } else if ([68].indexOf(keyCode) >= 0) { + + event.preventDefault(); + previousFeed(navigationArea); + } } |