summaryrefslogtreecommitdiffstats
path: root/static/functions/notifications.js
diff options
context:
space:
mode:
authorGit <git@what.cd>2013-09-03 08:01:00 +0000
committerGit <git@what.cd>2013-09-03 08:01:00 +0000
commit5b80249db6cd9cf3271de89738d844fdb14a0659 (patch)
tree1a27051ab944ef93d20d9df628af8af7d895bacc /static/functions/notifications.js
parentf269fa54549295ccedcdfa341090249527fc69b6 (diff)
downloadGazelle-5b80249db6cd9cf3271de89738d844fdb14a0659.zip
Gazelle-5b80249db6cd9cf3271de89738d844fdb14a0659.tar.gz
Gazelle-5b80249db6cd9cf3271de89738d844fdb14a0659.tar.bz2
Empty commit
Diffstat (limited to 'static/functions/notifications.js')
-rw-r--r--static/functions/notifications.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/static/functions/notifications.js b/static/functions/notifications.js
index 7c8b826..dbd94c4 100644
--- a/static/functions/notifications.js
+++ b/static/functions/notifications.js
@@ -23,3 +23,21 @@ function clearSelected(filterId) {
}
});
}
+
+$(document).ready(function () {
+ var notifyBoxes = $('.notify_box');
+ notifyBoxes.keydown(function(e) {
+ var nextBox, index = notifyBoxes.index($(this));
+ if (index > 0 && e.which === 75) { // K
+ nextBox = notifyBoxes.get(index-1);
+ } else if (index < notifyBoxes.size()-1 && e.which === 74) { // J
+ nextBox = notifyBoxes.get(index+1);
+ } else if (e.which === 88) {
+ $(this).prop('checked', !$(this).prop('checked'));
+ }
+ if (nextBox) {
+ nextBox.focus();
+ $(window).scrollTop($(nextBox).position()['top']-$(window).height()/4);
+ }
+ });
+});