diff options
author | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-02-06 12:11:34 -0600 |
---|---|---|
committer | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-02-10 15:09:08 -0600 |
commit | 178be67df221d46c5053a72917860775b343bc7d (patch) | |
tree | b69c71c83bed7dd8ba94e326a924a99332008017 /app | |
parent | 647d2b08cde74228728aeb12486c23e5f8e1b317 (diff) | |
download | gitlab-ce-178be67df221d46c5053a72917860775b343bc7d.tar.gz |
Set height of fixed sidebars with js
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/sidebar.js.es6 | 11 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/issuable.scss | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/app/assets/javascripts/sidebar.js.es6 b/app/assets/javascripts/sidebar.js.es6 index 24423dccf1f..6c3a1f3307a 100644 --- a/app/assets/javascripts/sidebar.js.es6 +++ b/app/assets/javascripts/sidebar.js.es6 @@ -35,13 +35,16 @@ window.innerWidth >= sidebarBreakpoint && $(pageSelector).hasClass(expandedPageClass) ); + $(window).on('resize', () => this.setSidebarHeight()); $(document) .on('click', sidebarToggleSelector, () => this.toggleSidebar()) .on('click', pinnedToggleSelector, () => this.togglePinnedState()) .on('click', 'html, body, a, button', (e) => this.handleClickEvent(e)) .on('DOMContentLoaded', () => this.renderState()) + .on('scroll', () => this.setSidebarHeight()) .on('todo:toggle', (e, count) => this.updateTodoCount(count)); this.renderState(); + this.setSidebarHeight(); } handleClickEvent(e) { @@ -64,6 +67,14 @@ this.renderState(); } + setSidebarHeight() { + const $navHeight = $('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight(); + const diff = $navHeight - $('body').scrollTop(); + if (diff > 0) { + $('.right-sidebar').outerHeight($(window).height() - diff); + } + } + togglePinnedState() { this.isPinned = !this.isPinned; if (!this.isPinned) { diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index 130103a2702..da5c44b5fdc 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -190,7 +190,6 @@ .right-sidebar { position: absolute; - height: 100%; top: $header-height; bottom: 0; right: 0; |