summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEzekiel Kigbo <ekigbo@gitlab.com>2019-03-04 15:50:16 +1100
committerEzekiel Kigbo <ekigbo@gitlab.com>2019-03-05 00:58:22 +1100
commit3e42a0c175d43609ea7b12f39ca3caae22eea817 (patch)
treed660b65f11ba8fa7517c1b48e68be0cd7f2813e6
parentd53005ef167de0a4b5b560d173435f3e0d0b4d9f (diff)
downloadgitlab-ce-3e42a0c175d43609ea7b12f39ca3caae22eea817.tar.gz
Removed force toggle .nav-sidebar on any click event
Added note describing expected behaviour
-rw-r--r--app/assets/javascripts/contextual_sidebar.js12
-rw-r--r--app/assets/stylesheets/framework/contextual_sidebar.scss5
2 files changed, 6 insertions, 11 deletions
diff --git a/app/assets/javascripts/contextual_sidebar.js b/app/assets/javascripts/contextual_sidebar.js
index 7780ac8a1d2..8561383c574 100644
--- a/app/assets/javascripts/contextual_sidebar.js
+++ b/app/assets/javascripts/contextual_sidebar.js
@@ -26,14 +26,6 @@ export default class ContextualSidebar {
bindEvents() {
if (!this.$sidebar.length) return;
- document.addEventListener('click', e => {
- if (
- !e.target.closest('.nav-sidebar') &&
- (bp.getBreakpointSize() === 'sm' || bp.getBreakpointSize() === 'md')
- ) {
- this.toggleCollapsedSidebar(true, true);
- }
- });
this.$openSidebar.on('click', () => this.toggleSidebarNav(true));
this.$closeSidebar.on('click', () => this.toggleSidebarNav(false));
this.$overlay.on('click', () => this.toggleSidebarNav(false));
@@ -49,9 +41,9 @@ export default class ContextualSidebar {
$(window).on('resize', () => _.debounce(this.render(), 100));
}
- // NOTE: at 1200px sidebar should be in 'desktop' mode
+ // NOTE: at 1200px nav sidebar should be in 'desktop mode' (not overlap the content)
// https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24555#note_134136110
- // But, current behaviour starts desktop mode at 1201px
+ // But setting 'desktop mode' at 1200px will break spec/support/features/reportable_note_shared_examples.rb
// TODO: use the breakpoints from breakpoints.js once they have been updated for bootstrap 4
// See related issue and discussion: https://gitlab.com/gitlab-org/gitlab-ce/issues/56745
diff --git a/app/assets/stylesheets/framework/contextual_sidebar.scss b/app/assets/stylesheets/framework/contextual_sidebar.scss
index 79c770a3a35..7601cb671e2 100644
--- a/app/assets/stylesheets/framework/contextual_sidebar.scss
+++ b/app/assets/stylesheets/framework/contextual_sidebar.scss
@@ -5,8 +5,11 @@
padding-left: $contextual-sidebar-collapsed-width;
}
-
+ // NOTE: at 1200px nav sidebar should be in 'desktop mode' (not overlap the content)
+ // https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24555#note_134136110
+ // But setting 'desktop mode' at 1200px will break spec/support/features/reportable_note_shared_examples.rb
$desktop-nav-sidebar-breakpoint: 1201px;
+
@media (min-width: $desktop-nav-sidebar-breakpoint) {
padding-left: $contextual-sidebar-width;
}