Trigger sticky_kit:recalc when diffs are pre-loaded
This commit is contained in:
parent
4e7f23fe0b
commit
d2b5c3f6ce
|
@ -50,8 +50,10 @@ class @MergeRequestTabs
|
|||
@_location = location
|
||||
|
||||
switch @opts.action
|
||||
when 'commits' then @commitsLoaded = true
|
||||
when 'diffs' then @diffsLoaded = true
|
||||
when 'commits'
|
||||
@commitsLoaded = true
|
||||
when 'diffs'
|
||||
@diffsLoaded = true
|
||||
|
||||
@bindEvents()
|
||||
@activateTab(@opts.action)
|
||||
|
@ -67,6 +69,7 @@ class @MergeRequestTabs
|
|||
@loadCommits($target.attr('href'))
|
||||
else if action == 'diffs'
|
||||
@loadDiff($target.attr('href'))
|
||||
@stickyDiffHeaders()
|
||||
|
||||
@setCurrentAction(action)
|
||||
|
||||
|
@ -134,12 +137,15 @@ class @MergeRequestTabs
|
|||
url: "#{source}.json"
|
||||
success: (data) =>
|
||||
document.getElementById('diffs').innerHTML = data.html
|
||||
$('.diff-header').trigger('sticky_kit:recalc')
|
||||
@stickyDiffHeaders()
|
||||
@diffsLoaded = true
|
||||
|
||||
toggleLoading: ->
|
||||
$('.mr-loading-status .loading').toggle()
|
||||
|
||||
stickyDiffHeaders: ->
|
||||
$('.diff-header').trigger('sticky_kit:recalc')
|
||||
|
||||
_get: (options) ->
|
||||
defaults = {
|
||||
beforeSend: @toggleLoading
|
||||
|
|
Loading…
Reference in New Issue