summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/merge_request_tabs.js.coffee
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-25 21:26:20 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-25 21:26:20 -0400
commitd2b5c3f6ce1e5141e16bed748ed30a74c72435a7 (patch)
treef056fc377469d63a5e34325e3c496d182cd94123 /app/assets/javascripts/merge_request_tabs.js.coffee
parent4e7f23fe0bcb547109d369a7e32db170049d0f21 (diff)
downloadgitlab-ce-d2b5c3f6ce1e5141e16bed748ed30a74c72435a7.tar.gz
Trigger sticky_kit:recalc when diffs are pre-loaded
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js.coffee')
-rw-r--r--app/assets/javascripts/merge_request_tabs.js.coffee12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee
index 918936a9eb9..5dc441f64b5 100644
--- a/app/assets/javascripts/merge_request_tabs.js.coffee
+++ b/app/assets/javascripts/merge_request_tabs.js.coffee
@@ -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