Changes the width of sidebar in issues and MRs when affix event fires

This commit is contained in:
Phil Hughes 2015-03-26 21:23:31 +00:00
parent 090f2344ec
commit 81ff63d684
2 changed files with 8 additions and 1 deletions

View File

@ -22,3 +22,7 @@ class @Issue
@top = ($('.issuable-affix').offset().top - 70) @top = ($('.issuable-affix').offset().top - 70)
bottom: -> bottom: ->
@bottom = $('.footer').outerHeight(true) @bottom = $('.footer').outerHeight(true)
$('.issuable-affix').on 'affix.bs.affix', ->
$(@).width($(@).outerWidth())
.on 'affixed-top.bs.affix affixed-bottom.bs.affix', ->
$(@).width('')

View File

@ -26,6 +26,10 @@ class @MergeRequest
@top = ($('.issuable-affix').offset().top - 70) @top = ($('.issuable-affix').offset().top - 70)
bottom: -> bottom: ->
@bottom = $('.footer').outerHeight(true) @bottom = $('.footer').outerHeight(true)
$('.issuable-affix').on 'affix.bs.affix', ->
$(@).width($(@).outerWidth())
.on 'affixed-top.bs.affix affixed-bottom.bs.affix', ->
$(@).width('')
# Local jQuery finder # Local jQuery finder
$: (selector) -> $: (selector) ->
@ -164,4 +168,3 @@ class @MergeRequest
else else
setTimeout(merge_request.mergeInProgress, 3000) setTimeout(merge_request.mergeInProgress, 3000)
dataType: 'json' dataType: 'json'