Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
0c6c481f4836
Commit
6c9f5a50
authored
Jun 23, 2016
by
Alfredo Sumaran
Browse files
Skip element that is wrapped by a link
This fixes the double request being made to the same URL
parent
8e1d4c8aad34
Changes
1
Show whitespace changes
Inline
Side-by-side
app/assets/javascripts/tree.js.coffee
View file @
0c6c481f
...
...
@@ -5,7 +5,9 @@ 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"
)
$clickedEl
=
$
(
e
.
target
)
if
not
$clickedEl
.
is
(
'a'
)
and
not
$clickedEl
.
is
(
'.str-truncated'
)
path
=
$
(
'.tree-item-file-name a'
,
this
).
attr
(
'href'
)
Turbolinks
.
visit
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment