summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <theephil@gmail.com>2015-03-26 21:23:31 +0000
committerPhil Hughes <theephil@gmail.com>2015-03-26 21:23:31 +0000
commit81ff63d6849773f4cb5720bbcacfa92c93548f9b (patch)
tree8a423c1ab20e557fc2aed3c136bf3cd9357f4c61
parent090f2344ecb6631b20df5853045536f1eb0589d3 (diff)
downloadgitlab-ce-81ff63d6849773f4cb5720bbcacfa92c93548f9b.tar.gz
Changes the width of sidebar in issues and MRs when affix event fires
-rw-r--r--app/assets/javascripts/issue.js.coffee4
-rw-r--r--app/assets/javascripts/merge_request.js.coffee5
2 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee
index bf71c144eaf..89c17ed4dc2 100644
--- a/app/assets/javascripts/issue.js.coffee
+++ b/app/assets/javascripts/issue.js.coffee
@@ -22,3 +22,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('')
diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee
index 6127d2bb480..8ce5a3645c6 100644
--- a/app/assets/javascripts/merge_request.js.coffee
+++ b/app/assets/javascripts/merge_request.js.coffee
@@ -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) ->
@@ -164,4 +168,3 @@ class @MergeRequest
else
setTimeout(merge_request.mergeInProgress, 3000)
dataType: 'json'
-