diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-10 10:42:36 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-10 10:42:36 +0100 |
commit | 69f9ee28f819c9bd38a0a950f5314d7933a95d7f (patch) | |
tree | 5a67c2d5160a66c5a5ce241ffc5e38914628a1d8 | |
parent | 2925850ceec3ef89eb1f60b0a648dbc5f72d8683 (diff) | |
download | gitlab-ce-69f9ee28f819c9bd38a0a950f5314d7933a95d7f.tar.gz |
Remove affix plugin from issuable sidebar with new navigationremove-affix-issuable-sidebar-new-nav
This isn't required with the new navigation as it is always position fixed so we are just creating a scroll event listener that will never actually do anything
-rw-r--r-- | app/assets/javascripts/sidebar_height_manager.js | 3 | ||||
-rw-r--r-- | app/views/shared/issuable/_sidebar.html.haml | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/sidebar_height_manager.js b/app/assets/javascripts/sidebar_height_manager.js index df19d7305f8..2752fe2b911 100644 --- a/app/assets/javascripts/sidebar_height_manager.js +++ b/app/assets/javascripts/sidebar_height_manager.js @@ -1,8 +1,11 @@ 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() + diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index c2de6926460..c3f25c9d255 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -3,7 +3,7 @@ = page_specific_javascript_bundle_tag('common_vue') = page_specific_javascript_bundle_tag('sidebar') -%aside.right-sidebar.js-right-sidebar{ data: { "offset-top" => "50", "spy" => "affix", signed: { in: current_user.present? } }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' } +%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { "offset-top" => ("50" unless show_new_nav?), "spy" => ("affix" unless show_new_nav?), signed: { in: current_user.present? } }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' } .issuable-sidebar{ data: { endpoint: "#{issuable_json_path(issuable)}" } } - can_edit_issuable = can?(current_user, :"admin_#{issuable.to_ability_name}", @project) .block.issuable-sidebar-header |