diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-04-30 18:25:49 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-04-30 18:25:49 +0200 |
commit | 2e54780c1496bfa39cd035b9ac40ed851d2198f1 (patch) | |
tree | b9991f6306bbf266942d56525175868448a35402 /js/build/app.js | |
parent | 5515371a8017b6df6b7824da7fa7b97c57344c32 (diff) |
fix #635
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/js/build/app.js b/js/build/app.js index 3cf5c1a28..58ce9d426 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -2079,6 +2079,14 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL) ); }; + var markAllRead = function (navigationArea) { + var selector = '.active > .app-navigation-entry-menu .mark-read button'; + var button = navigationArea.find(selector); + if (button.length > 0) { + button.trigger('click'); + } + }; + var isInScrollView = function (elem, scrollArea) { // offset().top adds the navigation bar too so we have to subract it var elemTop = elem.offset().top - scrollArea.offset().top; @@ -2384,15 +2392,15 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL) $(document).keyup(function (event) { - if (noInputFocused($(':focus')) && noModifierKey(event)) { - var keyCode = event.keyCode; - var scrollArea = $('#app-content'); - var navigationArea = $('#app-navigation'); - var isCompactView = $('#articles.compact').length > 0; - var isExpandItem = $('#articles') - .attr('news-compact-expand') === 'true'; - var expandItemInCompact = isCompactView && isExpandItem; + var keyCode = event.keyCode; + var scrollArea = $('#app-content'); + var navigationArea = $('#app-navigation'); + var isCompactView = $('#articles.compact').length > 0; + var isExpandItem = $('#articles') + .attr('news-compact-expand') === 'true'; + var expandItemInCompact = isCompactView && isExpandItem; + if (noInputFocused($(':focus')) && noModifierKey(event)) { // j, n, right arrow if ([74, 78, 39].indexOf(keyCode) >= 0) { @@ -2481,9 +2489,21 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL) // page up } else if ([33].indexOf(keyCode) >= 0) { + tryReload(navigationArea, scrollArea); + } + // everything with shift + } else if (noInputFocused($(':focus')) && event.shiftKey) { + + // shift + a + if ([65].indexOf(keyCode) >= 0) { + + event.preventDefault(); + markAllRead(navigationArea); + + } } }); |