Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 12:08:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 12:08:42 +0300
commitb76ae638462ab0f673e5915986070518dd3f9ad3 (patch)
treebdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/assets/javascripts/nav
parent434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff)
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/assets/javascripts/nav')
-rw-r--r--app/assets/javascripts/nav/components/responsive_app.vue14
-rw-r--r--app/assets/javascripts/nav/event_hub.js5
-rw-r--r--app/assets/javascripts/nav/index.js5
-rw-r--r--app/assets/javascripts/nav/utils/has_menu_expanded.js2
-rw-r--r--app/assets/javascripts/nav/utils/index.js1
5 files changed, 5 insertions, 22 deletions
diff --git a/app/assets/javascripts/nav/components/responsive_app.vue b/app/assets/javascripts/nav/components/responsive_app.vue
index d601586a3f8..68a39f862fc 100644
--- a/app/assets/javascripts/nav/components/responsive_app.vue
+++ b/app/assets/javascripts/nav/components/responsive_app.vue
@@ -2,8 +2,7 @@
import { FREQUENT_ITEMS_PROJECTS, FREQUENT_ITEMS_GROUPS } from '~/frequent_items/constants';
import { BV_DROPDOWN_SHOW, BV_DROPDOWN_HIDE } from '~/lib/utils/constants';
import KeepAliveSlots from '~/vue_shared/components/keep_alive_slots.vue';
-import eventHub, { EVENT_RESPONSIVE_TOGGLE } from '../event_hub';
-import { resetMenuItemsActive, hasMenuExpanded } from '../utils';
+import { resetMenuItemsActive } from '../utils';
import ResponsiveHeader from './responsive_header.vue';
import ResponsiveHome from './responsive_home.vue';
import TopNavContainerView from './top_nav_container_view.vue';
@@ -33,25 +32,14 @@ export default {
},
},
created() {
- eventHub.$on(EVENT_RESPONSIVE_TOGGLE, this.updateResponsiveOpen);
this.$root.$on(BV_DROPDOWN_SHOW, this.showMobileOverlay);
this.$root.$on(BV_DROPDOWN_HIDE, this.hideMobileOverlay);
-
- this.updateResponsiveOpen();
},
beforeDestroy() {
- eventHub.$off(EVENT_RESPONSIVE_TOGGLE, this.onToggle);
this.$root.$off(BV_DROPDOWN_SHOW, this.showMobileOverlay);
this.$root.$off(BV_DROPDOWN_HIDE, this.hideMobileOverlay);
},
methods: {
- updateResponsiveOpen() {
- if (hasMenuExpanded()) {
- document.body.classList.add('top-nav-responsive-open');
- } else {
- document.body.classList.remove('top-nav-responsive-open');
- }
- },
onMenuItemClick({ view }) {
if (view) {
this.activeView = view;
diff --git a/app/assets/javascripts/nav/event_hub.js b/app/assets/javascripts/nav/event_hub.js
deleted file mode 100644
index 2c8b1371fe3..00000000000
--- a/app/assets/javascripts/nav/event_hub.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import eventHubFactory from '~/helpers/event_hub_factory';
-
-export const EVENT_RESPONSIVE_TOGGLE = 'top-nav-responsive-toggle';
-
-export default eventHubFactory();
diff --git a/app/assets/javascripts/nav/index.js b/app/assets/javascripts/nav/index.js
index 86d6b42e4ea..abd537d2c9a 100644
--- a/app/assets/javascripts/nav/index.js
+++ b/app/assets/javascripts/nav/index.js
@@ -1,4 +1,7 @@
-// With combined_menu feature flag, there's a benefit to splitting up the import
+// TODO: With the combined_menu feature flag removed, there's likely a better
+// way to slice up the async import (i.e., include trigger in main bundle, but
+// async import subviews. Don't do this at the cost of UX).
+// See https://gitlab.com/gitlab-org/gitlab/-/issues/336042
const importModule = () => import(/* webpackChunkName: 'top_nav' */ './mount');
const tryMountTopNav = async () => {
diff --git a/app/assets/javascripts/nav/utils/has_menu_expanded.js b/app/assets/javascripts/nav/utils/has_menu_expanded.js
deleted file mode 100644
index 5f126bbdf76..00000000000
--- a/app/assets/javascripts/nav/utils/has_menu_expanded.js
+++ /dev/null
@@ -1,2 +0,0 @@
-export const hasMenuExpanded = () =>
- Boolean(document.querySelector('.header-content.menu-expanded'));
diff --git a/app/assets/javascripts/nav/utils/index.js b/app/assets/javascripts/nav/utils/index.js
index 4fa3d0910da..6d93818f0d3 100644
--- a/app/assets/javascripts/nav/utils/index.js
+++ b/app/assets/javascripts/nav/utils/index.js
@@ -1,2 +1 @@
-export * from './has_menu_expanded';
export * from './reset_menu_items_active';