summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Blessing <drew.blessing@mac.com>2015-04-03 13:23:11 +0000
committerDrew Blessing <drew.blessing@mac.com>2015-04-03 13:23:11 +0000
commitaedc12547aa87827ebb330481da957ba974708b8 (patch)
tree60b23683666f8845b390e2993ab7681808dd1c31
parent965b92a725e5570e09bdd4609d4ddd896fddcbab (diff)
parent81ff63d6849773f4cb5720bbcacfa92c93548f9b (diff)
downloadgitlab-ce-aedc12547aa87827ebb330481da957ba974708b8.tar.gz
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
-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 0aaa62d2b82..4e2e6550eb2 100644
--- a/app/assets/javascripts/issue.js.coffee
+++ b/app/assets/javascripts/issue.js.coffee
@@ -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('')
diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee
index 2cbe03b986a..fc75f143836 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) ->
@@ -160,4 +164,3 @@ class @MergeRequest
else
setTimeout(merge_request.mergeInProgress, 3000)
dataType: 'json'
-