Fix anchors to comments in diffs
This commit is contained in:
parent
0de7c83a78
commit
31330e4a3c
2 changed files with 8 additions and 0 deletions
|
@ -29,6 +29,7 @@ v 8.1.0 (unreleased)
|
|||
- Ensure code blocks are properly highlighted after a note is updated
|
||||
- Fix wrong access level badge on MR comments
|
||||
- Hide password in the service settings form
|
||||
- Fix anchors to comments in diffs
|
||||
|
||||
v 8.0.3
|
||||
- Fix URL shown in Slack notifications
|
||||
|
|
|
@ -66,6 +66,11 @@ class @MergeRequestTabs
|
|||
|
||||
@setCurrentAction(action)
|
||||
|
||||
scrollToElement: (container) ->
|
||||
if window.location.hash
|
||||
top = $(container + " " + window.location.hash).offset().top
|
||||
$('body').scrollTo(top);
|
||||
|
||||
# Activate a tab based on the current action
|
||||
activateTab: (action) ->
|
||||
action = 'notes' if action == 'show'
|
||||
|
@ -122,6 +127,7 @@ class @MergeRequestTabs
|
|||
document.getElementById('commits').innerHTML = data.html
|
||||
$('.js-timeago').timeago()
|
||||
@commitsLoaded = true
|
||||
@scrollToElement(".commits")
|
||||
|
||||
loadDiff: (source) ->
|
||||
return if @diffsLoaded
|
||||
|
@ -131,6 +137,7 @@ class @MergeRequestTabs
|
|||
success: (data) =>
|
||||
document.getElementById('diffs').innerHTML = data.html
|
||||
@diffsLoaded = true
|
||||
@scrollToElement(".diffs")
|
||||
|
||||
toggleLoading: ->
|
||||
$('.mr-loading-status .loading').toggle()
|
||||
|
|
Loading…
Reference in a new issue