Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
f3ed4763
Commit
f3ed4763
authored
Apr 12, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly scrolls to the line when clicking
parent
8a8d4c9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
app/assets/javascripts/merge_request_tabs.js.coffee
app/assets/javascripts/merge_request_tabs.js.coffee
+10
-2
No files found.
app/assets/javascripts/merge_request_tabs.js.coffee
View file @
f3ed4763
...
...
@@ -88,7 +88,6 @@ class @MergeRequestTabs
navBarHeight
=
$
(
'.navbar-gitlab'
).
outerHeight
()
$el
=
$
(
"
#{
container
}
#{
window
.
location
.
hash
}
"
)
$
(
'body'
).
scrollTo
0
$
.
scrollTo
(
"
#{
container
}
#{
window
.
location
.
hash
}
"
,
offset
:
-
navBarHeight
)
if
$el
.
length
# Activate a tab based on the current action
...
...
@@ -163,8 +162,17 @@ class @MergeRequestTabs
@
scrollToElement
(
"#diffs"
)
@
highlighSelectedLine
()
$
(
document
)
.
off
'click'
,
'.diff-content a'
.
on
'click'
,
'.diff-content a'
,
(
e
)
=>
e
.
preventDefault
()
window
.
location
.
hash
=
$
(
e
.
currentTarget
).
attr
'href'
@
highlighSelectedLine
()
@
scrollToElement
(
"#diffs"
)
highlighSelectedLine
:
->
locationHash
=
location
.
hash
$
(
'.hll'
).
removeClass
'hll'
locationHash
=
window
.
location
.
hash
if
locationHash
isnt
''
hashClassString
=
".
#{
locationHash
.
replace
(
'#'
,
''
)
}
"
...
...
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