summaryrefslogtreecommitdiffstats
path: root/js/build/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/build/app.js')
-rw-r--r--js/build/app.js36
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);
+
+ }
}
});