Merge branch 'issue-sidebar-size' into 'master'

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

Fixes #1320

Width is set when Bootstraps affix event is fired and then removed when it reaches the top or bottom.

See merge request !464
This commit is contained in:
Drew Blessing 2015-04-03 13:23:11 +00:00
commit aedc12547a
2 changed files with 8 additions and 1 deletions

View File

@ -18,3 +18,7 @@ class @Issue
@top = ($('.issuable-affix').offset().top - 70)
bottom: ->
@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)
bottom: ->
@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
$: (selector) ->
@ -160,4 +164,3 @@ class @MergeRequest
else
setTimeout(merge_request.mergeInProgress, 3000)
dataType: 'json'