summaryrefslogtreecommitdiffstats
path: root/js/app
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-06-07 19:02:54 +0200
committerMorris Jobke <morris.jobke@gmail.com>2013-06-07 19:02:54 +0200
commitfa7553a05d27b6a8179aa609d4d2a26490d0b64a (patch)
tree8d8ec1aeb24002fc40e563d2c7a4e279f14f081e /js/app
parent4fe9d788174e513db005eae167fea986113bec74 (diff)
add shortcut to open current item
Diffstat (limited to 'js/app')
-rw-r--r--js/app/directives/itemshortcuts.coffee8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/app/directives/itemshortcuts.coffee b/js/app/directives/itemshortcuts.coffee
index 9045ea949..1d01a41a2 100644
--- a/js/app/directives/itemshortcuts.coffee
+++ b/js/app/directives/itemshortcuts.coffee
@@ -79,6 +79,10 @@ angular.module('News').directive 'itemShortcuts', ['$window', ($window) ->
$item.find('.star').trigger('click')
+ openCurrentItem = (scrollArea) ->
+ $item = getCurrentItem(scrollArea)
+ $item.find('.item_title a').trigger('click')
+
$($window.document).keydown (e) ->
# only activate if no input elements is focused
@@ -112,5 +116,9 @@ angular.module('News').directive 'itemShortcuts', ['$window', ($window) ->
starCurrentItem(scrollArea)
jumpToNextItem(scrollArea)
+ # o
+ else if e.keyCode == 79
+ openCurrentItem(scrollArea)
+
] \ No newline at end of file