diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-06-07 19:15:25 +0200 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-06-07 19:15:25 +0200 |
commit | 23cf5cfe6cf9c4840114087030b319baa26aaf06 (patch) | |
tree | ce421612b9faff00d512a4770715fd0ebe198ab2 /js | |
parent | fa7553a05d27b6a8179aa609d4d2a26490d0b64a (diff) |
fix open in new window
Diffstat (limited to 'js')
-rw-r--r-- | js/app/directives/itemshortcuts.coffee | 7 | ||||
-rw-r--r-- | js/public/app.js | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/js/app/directives/itemshortcuts.coffee b/js/app/directives/itemshortcuts.coffee index 1d01a41a2..076da571e 100644 --- a/js/app/directives/itemshortcuts.coffee +++ b/js/app/directives/itemshortcuts.coffee @@ -80,8 +80,9 @@ angular.module('News').directive 'itemShortcuts', ['$window', ($window) -> openCurrentItem = (scrollArea) -> - $item = getCurrentItem(scrollArea) - $item.find('.item_title a').trigger('click') + $item = getCurrentItem(scrollArea).find('.item_title a') + $item.trigger('click') + window.open($item.attr('href'), '_blank') $($window.document).keydown (e) -> @@ -106,7 +107,7 @@ angular.module('News').directive 'itemShortcuts', ['$window', ($window) -> # u else if e.keyCode == 85 keepUnreadCurrentItem(scrollArea) - + # s or i or l else if e.keyCode == 73 or e.keyCode == 83 or e.keyCode == 76 starCurrentItem(scrollArea) diff --git a/js/public/app.js b/js/public/app.js index bd8afeac7..c345d54d5 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -214,8 +214,9 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; openCurrentItem = function(scrollArea) { var $item; - $item = getCurrentItem(scrollArea); - return $item.find('.item_title a').trigger('click'); + $item = getCurrentItem(scrollArea).find('.item_title a'); + $item.trigger('click'); + return window.open($item.attr('href'), '_blank'); }; return $($window.document).keydown(function(e) { var focused, scrollArea; |