From a2ccd0d682ac683b4bf78e56510a463a74211090 Mon Sep 17 00:00:00 2001 From: MageFroh Date: Mon, 1 Jul 2013 22:36:20 +0100 Subject: [PATCH] middle-clicking on the feed in the category tree opens its website --- src/main/webapp/js/directives.js | 28 +++++++++++++++--------- src/main/webapp/templates/_category.html | 5 +++-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/main/webapp/js/directives.js b/src/main/webapp/js/directives.js index f1e9b6f7..737b19ba 100644 --- a/src/main/webapp/js/directives.js +++ b/src/main/webapp/js/directives.js @@ -257,16 +257,24 @@ module.directive('category', [ function() { return label; }; - $scope.feedClicked = function(id) { - MobileService.toggleLeftMenu(); - if ($scope.selectedType == 'feed' - && id == $scope.selectedId) { - $scope.$emit('emitReload'); - } else { - $state.transitionTo('feeds.view', { - _type : 'feed', - _id : id - }); + $scope.feedClicked = function(id, event) { + // Could be called by a middle click + if (!event || (!event.ctrlKey && event.which == 1)) { + MobileService.toggleLeftMenu(); + if ($scope.selectedType == 'feed' + && id == $scope.selectedId) { + $scope.$emit('emitReload'); + } else { + $state.transitionTo('feeds.view', { + _type : 'feed', + _id : id + }); + } + + if (event) { + event.preventDefault(); + event.stopPropagation(); + } } }; diff --git a/src/main/webapp/templates/_category.html b/src/main/webapp/templates/_category.html index 069a0877..5806b1d3 100644 --- a/src/main/webapp/templates/_category.html +++ b/src/main/webapp/templates/_category.html @@ -34,7 +34,8 @@
- @@ -47,4 +48,4 @@ - \ No newline at end of file +