Skip to content
Snippets Groups Projects
Commit 31330e4a authored by Valery Sizov's avatar Valery Sizov
Browse files

Fix anchors to comments in diffs

parent 0de7c83a
No related branches found
No related tags found
1 merge request!1508Fix anchors to comments in diffs
Pipeline #
Loading
@@ -29,6 +29,7 @@ v 8.1.0 (unreleased)
Loading
@@ -29,6 +29,7 @@ v 8.1.0 (unreleased)
- Ensure code blocks are properly highlighted after a note is updated - Ensure code blocks are properly highlighted after a note is updated
- Fix wrong access level badge on MR comments - Fix wrong access level badge on MR comments
- Hide password in the service settings form - Hide password in the service settings form
- Fix anchors to comments in diffs
   
v 8.0.3 v 8.0.3
- Fix URL shown in Slack notifications - Fix URL shown in Slack notifications
Loading
Loading
Loading
@@ -66,6 +66,11 @@ class @MergeRequestTabs
Loading
@@ -66,6 +66,11 @@ class @MergeRequestTabs
   
@setCurrentAction(action) @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 # Activate a tab based on the current action
activateTab: (action) -> activateTab: (action) ->
action = 'notes' if action == 'show' action = 'notes' if action == 'show'
Loading
@@ -122,6 +127,7 @@ class @MergeRequestTabs
Loading
@@ -122,6 +127,7 @@ class @MergeRequestTabs
document.getElementById('commits').innerHTML = data.html document.getElementById('commits').innerHTML = data.html
$('.js-timeago').timeago() $('.js-timeago').timeago()
@commitsLoaded = true @commitsLoaded = true
@scrollToElement(".commits")
   
loadDiff: (source) -> loadDiff: (source) ->
return if @diffsLoaded return if @diffsLoaded
Loading
@@ -131,6 +137,7 @@ class @MergeRequestTabs
Loading
@@ -131,6 +137,7 @@ class @MergeRequestTabs
success: (data) => success: (data) =>
document.getElementById('diffs').innerHTML = data.html document.getElementById('diffs').innerHTML = data.html
@diffsLoaded = true @diffsLoaded = true
@scrollToElement(".diffs")
   
toggleLoading: -> toggleLoading: ->
$('.mr-loading-status .loading').toggle() $('.mr-loading-status .loading').toggle()
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment