summaryrefslogtreecommitdiffstats
path: root/js/app/directives/itemshortcuts.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'js/app/directives/itemshortcuts.coffee')
-rw-r--r--js/app/directives/itemshortcuts.coffee12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/app/directives/itemshortcuts.coffee b/js/app/directives/itemshortcuts.coffee
index 367086fbb..546ea4dde 100644
--- a/js/app/directives/itemshortcuts.coffee
+++ b/js/app/directives/itemshortcuts.coffee
@@ -65,14 +65,13 @@ angular.module('News').directive 'itemShortcuts', ['$window', ($window) ->
$scrollArea.scrollTop($scrollArea.prop('scrollHeight'))
-
getCurrentItem = (scrollArea) ->
$scrollArea = $(scrollArea)
$items = $scrollArea.find('.feed_item')
for item in $items
$item = $(item)
# 130px of the item should be visible
- if ($item.height() + $item.position().top) > 110
+ if ($item.height() + $item.position().top) > 30
return $item
@@ -85,6 +84,10 @@ angular.module('News').directive 'itemShortcuts', ['$window', ($window) ->
$item = getCurrentItem(scrollArea)
$item.find('.star').trigger('click')
+ expandCurrentItem = (scrollArea) ->
+ $item = getCurrentItem(scrollArea)
+ $item.find('.item_heading a').trigger('click')
+
openCurrentItem = (scrollArea) ->
$item = getCurrentItem(scrollArea).find('.item_title a')
@@ -118,6 +121,11 @@ angular.module('News').directive 'itemShortcuts', ['$window', ($window) ->
e.preventDefault()
keepUnreadCurrentItem(scrollArea)
+ # e
+ else if e.keyCode == 69
+ e.preventDefault()
+ expandCurrentItem(scrollArea)
+
# s or i or l
else if e.keyCode == 73 or e.keyCode == 83 or e.keyCode == 76
e.preventDefault()