Skip to content
Snippets Groups Projects
Commit d2b5c3f6 authored by Robert Speicher's avatar Robert Speicher
Browse files

Trigger sticky_kit:recalc when diffs are pre-loaded

parent 4e7f23fe
No related branches found
No related tags found
No related merge requests found
Loading
@@ -50,8 +50,10 @@ class @MergeRequestTabs
Loading
@@ -50,8 +50,10 @@ class @MergeRequestTabs
@_location = location @_location = location
   
switch @opts.action switch @opts.action
when 'commits' then @commitsLoaded = true when 'commits'
when 'diffs' then @diffsLoaded = true @commitsLoaded = true
when 'diffs'
@diffsLoaded = true
   
@bindEvents() @bindEvents()
@activateTab(@opts.action) @activateTab(@opts.action)
Loading
@@ -67,6 +69,7 @@ class @MergeRequestTabs
Loading
@@ -67,6 +69,7 @@ class @MergeRequestTabs
@loadCommits($target.attr('href')) @loadCommits($target.attr('href'))
else if action == 'diffs' else if action == 'diffs'
@loadDiff($target.attr('href')) @loadDiff($target.attr('href'))
@stickyDiffHeaders()
   
@setCurrentAction(action) @setCurrentAction(action)
   
Loading
@@ -134,12 +137,15 @@ class @MergeRequestTabs
Loading
@@ -134,12 +137,15 @@ class @MergeRequestTabs
url: "#{source}.json" url: "#{source}.json"
success: (data) => success: (data) =>
document.getElementById('diffs').innerHTML = data.html document.getElementById('diffs').innerHTML = data.html
$('.diff-header').trigger('sticky_kit:recalc') @stickyDiffHeaders()
@diffsLoaded = true @diffsLoaded = true
   
toggleLoading: -> toggleLoading: ->
$('.mr-loading-status .loading').toggle() $('.mr-loading-status .loading').toggle()
   
stickyDiffHeaders: ->
$('.diff-header').trigger('sticky_kit:recalc')
_get: (options) -> _get: (options) ->
defaults = { defaults = {
beforeSend: @toggleLoading beforeSend: @toggleLoading
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