diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-03 18:24:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-03 18:24:33 +0300 |
commit | 2a7fd3827b0838a900399b0c3440942cdaa09c75 (patch) | |
tree | adb9315f24704a322c0c3e05da2f2b8e835fbf60 /app/assets/javascripts/super_sidebar | |
parent | 6e228f38c37c4c7b6d6be648ae2664ebfb5c3c80 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/super_sidebar')
3 files changed, 4 insertions, 34 deletions
diff --git a/app/assets/javascripts/super_sidebar/components/super_sidebar.vue b/app/assets/javascripts/super_sidebar/components/super_sidebar.vue index 00fb813728e..b7a9583cae9 100644 --- a/app/assets/javascripts/super_sidebar/components/super_sidebar.vue +++ b/app/assets/javascripts/super_sidebar/components/super_sidebar.vue @@ -2,7 +2,6 @@ import { GlButton, GlCollapse } from '@gitlab/ui'; import { __ } from '~/locale'; import { isCollapsed, toggleSuperSidebarCollapsed } from '../super_sidebar_collapsed_state_manager'; -import { SUPER_SIDEBAR_PEEK_DELAY } from '../constants'; import UserBar from './user_bar.vue'; import SidebarPortalTarget from './sidebar_portal_target.vue'; import ContextSwitcherToggle from './context_switcher_toggle.vue'; @@ -33,8 +32,7 @@ export default { data() { return { contextSwitcherOpen: false, - isInert: isCollapsed(), - isPeek: false, + isCollapased: isCollapsed(), }; }, computed: { @@ -49,18 +47,6 @@ export default { onContextSwitcherShown() { this.$refs['context-switcher'].focusInput(); }, - onMouseOver() { - setTimeout(() => { - this.isPeek = true; - this.isInert = false; - }, SUPER_SIDEBAR_PEEK_DELAY); - }, - onMouseLeave() { - setTimeout(() => { - this.isPeek = false; - this.isInert = true; - }, SUPER_SIDEBAR_PEEK_DELAY); - }, }, }; </script> @@ -68,21 +54,14 @@ export default { <template> <div> <div class="super-sidebar-overlay" @click="collapseSidebar"></div> - <div - v-if="!isPeek" - class="super-sidebar-hover-area gl-fixed gl-left-0 gl-top-0 gl-bottom-0 gl-w-3" - data-testid="super-sidebar-hover-area" - @mouseover="onMouseOver" - ></div> <aside id="super-sidebar" class="super-sidebar" - :class="{ 'gl-visibility-hidden': isInert, 'super-sidebar-peek': isPeek }" + :class="{ 'gl-visibility-hidden': isCollapased }" data-testid="super-sidebar" data-qa-selector="navbar" - :inert="isInert" + :inert="isCollapased" tabindex="-1" - @mouseleave="onMouseLeave" > <gl-button class="super-sidebar-skip-to gl-sr-only-focusable gl-absolute gl-left-3 gl-right-3 gl-top-3" @@ -91,7 +70,7 @@ export default { > {{ $options.i18n.skipToMainContent }} </gl-button> - <user-bar :has-collapse-button="!isPeek" :sidebar-data="sidebarData" /> + <user-bar :sidebar-data="sidebarData" /> <div class="gl-display-flex gl-flex-direction-column gl-flex-grow-1 gl-overflow-hidden"> <div class="gl-flex-grow-1 gl-overflow-auto"> <context-switcher-toggle diff --git a/app/assets/javascripts/super_sidebar/components/user_bar.vue b/app/assets/javascripts/super_sidebar/components/user_bar.vue index 34af935434c..62161f2846a 100644 --- a/app/assets/javascripts/super_sidebar/components/user_bar.vue +++ b/app/assets/javascripts/super_sidebar/components/user_bar.vue @@ -50,11 +50,6 @@ export default { }, inject: ['rootPath'], props: { - hasCollapseButton: { - default: true, - type: Boolean, - required: false, - }, sidebarData: { type: Object, required: true, @@ -94,12 +89,10 @@ export default { > <div class="gl-flex-grow-1"></div> <gl-button - v-if="hasCollapseButton" v-gl-tooltip:super-sidebar.hover.bottom="$options.i18n.collapseSidebar" aria-controls="super-sidebar" aria-expanded="true" :aria-label="$options.i18n.navigationSidebar" - data-testid="super-sidebar-collapse-button" icon="sidebar" category="tertiary" @click="collapseSidebar" diff --git a/app/assets/javascripts/super_sidebar/constants.js b/app/assets/javascripts/super_sidebar/constants.js index 23233ab7792..ad9d4bc43f2 100644 --- a/app/assets/javascripts/super_sidebar/constants.js +++ b/app/assets/javascripts/super_sidebar/constants.js @@ -13,7 +13,5 @@ export const portalState = Vue.observable({ export const MAX_FREQUENT_PROJECTS_COUNT = 5; export const MAX_FREQUENT_GROUPS_COUNT = 3; -export const SUPER_SIDEBAR_PEEK_DELAY = 150; - export const TRACKING_UNKNOWN_ID = 'item_without_id'; export const CLICK_MENU_ITEM_ACTION = 'click_menu_item'; |