diff options
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/group_name.js | 13 | ||||
-rw-r--r-- | app/assets/javascripts/issuable_bulk_update_sidebar.js | 25 | ||||
-rw-r--r-- | app/assets/javascripts/layout_nav.js | 15 | ||||
-rw-r--r-- | app/assets/javascripts/new_sidebar.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/right_sidebar.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/sidebar_height_manager.js | 37 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/boards.scss | 1 |
7 files changed, 7 insertions, 88 deletions
diff --git a/app/assets/javascripts/group_name.js b/app/assets/javascripts/group_name.js index 3e483b69fd2..6677391c689 100644 --- a/app/assets/javascripts/group_name.js +++ b/app/assets/javascripts/group_name.js @@ -1,4 +1,3 @@ -import Cookies from 'js-cookie'; import _ from 'underscore'; export default class GroupName { @@ -39,17 +38,9 @@ export default class GroupName { this.toggle.setAttribute('type', 'button'); this.toggle.className = 'text-expander group-name-toggle'; this.toggle.setAttribute('aria-label', 'Toggle full path'); - if (Cookies.get('new_nav') === 'true') { - this.toggle.innerHTML = '<i class="fa fa-ellipsis-h" aria-hidden="true"></i>'; - } else { - this.toggle.innerHTML = '...'; - } + this.toggle.innerHTML = '<i class="fa fa-ellipsis-h" aria-hidden="true"></i>'; this.toggle.addEventListener('click', this.toggleGroups.bind(this)); - if (Cookies.get('new_nav') === 'true') { - this.title.insertBefore(this.toggle, this.groupTitle); - } else { - this.titleContainer.insertBefore(this.toggle, this.title); - } + this.title.insertBefore(this.toggle, this.groupTitle); this.toggleGroups(); } diff --git a/app/assets/javascripts/issuable_bulk_update_sidebar.js b/app/assets/javascripts/issuable_bulk_update_sidebar.js index d314f3c4d43..0e8a0519928 100644 --- a/app/assets/javascripts/issuable_bulk_update_sidebar.js +++ b/app/assets/javascripts/issuable_bulk_update_sidebar.js @@ -5,7 +5,6 @@ /* global SubscriptionSelect */ import IssuableBulkUpdateActions from './issuable_bulk_update_actions'; -import SidebarHeightManager from './sidebar_height_manager'; const HIDDEN_CLASS = 'hidden'; const DISABLED_CONTENT_CLASS = 'disabled-content'; @@ -50,13 +49,6 @@ export default class IssuableBulkUpdateSidebar { new SubscriptionSelect(); } - getNavHeight() { - const navbarHeight = $('.navbar-gitlab').outerHeight(); - const layoutNavHeight = $('.layout-nav').outerHeight(); - const subNavScroll = $('.sub-nav-scroll').outerHeight(); - return navbarHeight + layoutNavHeight + subNavScroll; - } - setupBulkUpdateActions() { IssuableBulkUpdateActions.setOriginalDropdownData(); } @@ -84,23 +76,6 @@ export default class IssuableBulkUpdateSidebar { this.toggleBulkEditButtonDisabled(enable); this.toggleOtherFiltersDisabled(enable); this.toggleCheckboxDisplay(enable); - - if (enable) { - this.initAffix(); - SidebarHeightManager.init(); - } - } - - initAffix() { - if (!this.$sidebar.hasClass('affix-top')) { - const offsetTop = $('.scrolling-tabs-container').outerHeight() + $('.sub-nav-scroll').outerHeight(); - - this.$sidebar.affix({ - offset: { - top: offsetTop, - }, - }); - } } updateSelectedIssuableIds() { diff --git a/app/assets/javascripts/layout_nav.js b/app/assets/javascripts/layout_nav.js index 5c1ba416a03..d064a2c0024 100644 --- a/app/assets/javascripts/layout_nav.js +++ b/app/assets/javascripts/layout_nav.js @@ -50,19 +50,10 @@ import initFlyOutNav from './fly_out_nav'; }); }); - function applyScrollNavClass() { - const scrollOpacityHeight = 40; - $('.navbar-border').css('opacity', Math.min($(window).scrollTop() / scrollOpacityHeight, 1)); - } - $(() => { - if (Cookies.get('new_nav') === 'true') { - const newNavSidebar = new NewNavSidebar(); - newNavSidebar.bindEvents(); - - initFlyOutNav(); - } + const newNavSidebar = new NewNavSidebar(); + newNavSidebar.bindEvents(); - $(window).on('scroll', _.throttle(applyScrollNavClass, 100)); + initFlyOutNav(); }); }).call(window); diff --git a/app/assets/javascripts/new_sidebar.js b/app/assets/javascripts/new_sidebar.js index 05e3f33f5ed..709a5d33b9f 100644 --- a/app/assets/javascripts/new_sidebar.js +++ b/app/assets/javascripts/new_sidebar.js @@ -63,7 +63,7 @@ export default class NewNavSidebar { if (breakpoint === 'sm' || breakpoint === 'md') { this.toggleCollapsedSidebar(true); } else if (breakpoint === 'lg') { - const collapse = Cookies.get('sidebar_collapsed') === 'true'; + const collapse = this.$sidebar.hasClass('sidebar-icons-only'); this.toggleCollapsedSidebar(collapse); } } diff --git a/app/assets/javascripts/right_sidebar.js b/app/assets/javascripts/right_sidebar.js index 4c87d46c96e..a4eae135403 100644 --- a/app/assets/javascripts/right_sidebar.js +++ b/app/assets/javascripts/right_sidebar.js @@ -2,7 +2,6 @@ import _ from 'underscore'; import Cookies from 'js-cookie'; -import SidebarHeightManager from './sidebar_height_manager'; (function() { this.Sidebar = (function() { @@ -23,7 +22,6 @@ import SidebarHeightManager from './sidebar_height_manager'; }; Sidebar.prototype.addEventListeners = function() { - SidebarHeightManager.init(); const $document = $(document); this.sidebar.on('click', '.sidebar-collapsed-icon', this, this.sidebarCollapseClicked); diff --git a/app/assets/javascripts/sidebar_height_manager.js b/app/assets/javascripts/sidebar_height_manager.js deleted file mode 100644 index 2752fe2b911..00000000000 --- a/app/assets/javascripts/sidebar_height_manager.js +++ /dev/null @@ -1,37 +0,0 @@ -import _ from 'underscore'; -import Cookies from 'js-cookie'; - -export default { - init() { - if (!this.initialized) { - if (Cookies.get('new_nav') === 'true' && $('.js-issuable-sidebar').length) return; - - this.$window = $(window); - this.$rightSidebar = $('.js-right-sidebar'); - this.$navHeight = $('.navbar-gitlab').outerHeight() + - $('.layout-nav').outerHeight() + - $('.sub-nav-scroll').outerHeight(); - - const throttledSetSidebarHeight = _.throttle(() => this.setSidebarHeight(), 20); - const debouncedSetSidebarHeight = _.debounce(() => this.setSidebarHeight(), 200); - - this.$window.on('scroll', throttledSetSidebarHeight); - this.$window.on('resize', debouncedSetSidebarHeight); - this.initialized = true; - } - }, - - setSidebarHeight() { - const currentScrollDepth = window.pageYOffset || 0; - const diff = this.$navHeight - currentScrollDepth; - - if (diff > 0) { - const newSidebarHeight = window.innerHeight - diff; - this.$rightSidebar.outerHeight(newSidebarHeight); - this.sidebarHeightIsCustom = true; - } else if (this.sidebarHeightIsCustom) { - this.$rightSidebar.outerHeight('100%'); - this.sidebarHeightIsCustom = false; - } - }, -}; diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss index 0f3074076ce..314dd2d1a21 100644 --- a/app/assets/stylesheets/pages/boards.scss +++ b/app/assets/stylesheets/pages/boards.scss @@ -440,6 +440,7 @@ &.right-sidebar { top: 0; bottom: 0; + height: 100%; } .issuable-sidebar-header { |