Commit e27f5aef authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix sticky diff header

parent a9eba1bd
class @Diff class @Diff
UNFOLD_COUNT = 20 UNFOLD_COUNT = 20
constructor: -> constructor: ->
$(document).off('click', '.js-unfold')
$(document).on('click', '.js-unfold', (event) => $(document).on('click', '.js-unfold', (event) =>
target = $(event.target) target = $(event.target)
unfoldBottom = target.hasClass('js-unfold-bottom') unfoldBottom = target.hasClass('js-unfold-bottom')
...@@ -36,7 +37,7 @@ class @Diff ...@@ -36,7 +37,7 @@ class @Diff
) )
) )
$('.diff-header').stick_in_parent(offset_top: $('.navbar').height()) $('.diff-header').stick_in_parent(recalc_every: 1, offset_top: $('.navbar').height())
lineNumbers: (line) -> lineNumbers: (line) ->
return ([0, 0]) unless line.children().length return ([0, 0]) unless line.children().length
......
...@@ -95,6 +95,7 @@ class @MergeRequest ...@@ -95,6 +95,7 @@ class @MergeRequest
this.$('.merge-request-tabs .diffs-tab').addClass 'active' this.$('.merge-request-tabs .diffs-tab').addClass 'active'
this.loadDiff() unless @diffs_loaded this.loadDiff() unless @diffs_loaded
this.$('.diffs').show() this.$('.diffs').show()
$(".diff-header").trigger("sticky_kit:recalc")
when 'commits' when 'commits'
this.$('.merge-request-tabs .commits-tab').addClass 'active' this.$('.merge-request-tabs .commits-tab').addClass 'active'
this.$('.commits').show() this.$('.commits').show()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment