Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/tree.js.coffee')
-rw-r--r--app/assets/javascripts/tree.js.coffee12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/assets/javascripts/tree.js.coffee b/app/assets/javascripts/tree.js.coffee
index de8eebcd0b2..83de584f2d9 100644
--- a/app/assets/javascripts/tree.js.coffee
+++ b/app/assets/javascripts/tree.js.coffee
@@ -5,9 +5,15 @@ class @TreeView
# Code browser tree slider
# Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
$(".tree-content-holder .tree-item").on 'click', (e) ->
- if (e.target.nodeName != "A")
- path = $('.tree-item-file-name a', this).attr('href')
- Turbolinks.visit(path)
+ $clickedEl = $(e.target)
+ path = $('.tree-item-file-name a', this).attr('href')
+
+ if not $clickedEl.is('a') and not $clickedEl.is('.str-truncated')
+ if e.metaKey or e.which is 2
+ e.preventDefault()
+ window.open path, '_blank'
+ else
+ Turbolinks.visit path
# Show the "Loading commit data" for only the first element
$('span.log_loading:first').removeClass('hide')