summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-02-04 08:50:25 -0500
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-02-04 08:50:25 -0500
commitf25ba6e03c6635b75a46e6f53c3cfee8109b74f9 (patch)
tree25fbdb688bef167034b0513e97b3410f5e61fd27
parente0efdc4bf759ed8129d12aed16e68fb7392eddc7 (diff)
downloadgitlab-ce-f25ba6e03c6635b75a46e6f53c3cfee8109b74f9.tar.gz
Resize sidebar on initial page refresh.
-rw-r--r--app/assets/javascripts/application.js.coffee12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index 1abc4794f21..b7c465401be 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -269,11 +269,19 @@ $ ->
'<div class="device-lg visible-lg"></div>')
checkBootstrapBreakpoints()
- $(window).on "resize", (e) ->
+ fitSidebarForSize = ->
oldBootstrapBreakpoint = bootstrapBreakpoint
checkBootstrapBreakpoints()
if bootstrapBreakpoint != oldBootstrapBreakpoint
- $(document).trigger('breakpoint:change',[bootstrapBreakpoint])
+ $(document).trigger('breakpoint:change', [bootstrapBreakpoint])
+
+ checkInitialSidebarSize = ->
+ if bootstrapBreakpoint is "xs" or "sm"
+ $(document).trigger('breakpoint:change', [bootstrapBreakpoint])
+
+ $(window).on "resize", (e) ->
+ fitSidebarForSize()
setBootstrapBreakpoints()
+ checkInitialSidebarSize()
new Aside()