2021-06-08 01:23:25 +05:30
|
|
|
<script>
|
2022-10-11 01:57:18 +05:30
|
|
|
import { GlNav, GlIcon, GlNavItemDropdown, GlDropdownForm, GlTooltipDirective } from '@gitlab/ui';
|
2022-11-25 23:54:43 +05:30
|
|
|
import Tracking from '~/tracking';
|
2021-06-08 01:23:25 +05:30
|
|
|
import TopNavDropdownMenu from './top_nav_dropdown_menu.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2022-10-11 01:57:18 +05:30
|
|
|
GlIcon,
|
2021-06-08 01:23:25 +05:30
|
|
|
GlNav,
|
|
|
|
GlNavItemDropdown,
|
|
|
|
GlDropdownForm,
|
|
|
|
TopNavDropdownMenu,
|
|
|
|
},
|
2022-10-11 01:57:18 +05:30
|
|
|
directives: {
|
|
|
|
GlTooltip: GlTooltipDirective,
|
|
|
|
},
|
2021-06-08 01:23:25 +05:30
|
|
|
props: {
|
|
|
|
navData: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2022-11-25 23:54:43 +05:30
|
|
|
methods: {
|
|
|
|
trackToggleEvent() {
|
|
|
|
Tracking.event(undefined, 'click_nav', {
|
|
|
|
label: 'hamburger_menu',
|
|
|
|
property: 'top_navigation',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
2021-06-08 01:23:25 +05:30
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<gl-nav class="navbar-sub-nav">
|
|
|
|
<gl-nav-item-dropdown
|
2022-10-11 01:57:18 +05:30
|
|
|
v-gl-tooltip.bottom="navData.menuTooltip"
|
2021-09-04 01:27:46 +05:30
|
|
|
data-qa-selector="navbar_dropdown"
|
2022-10-11 01:57:18 +05:30
|
|
|
data-qa-title="Menu"
|
2021-09-04 01:27:46 +05:30
|
|
|
menu-class="gl-mt-3! gl-max-w-none! gl-max-h-none! gl-sm-w-auto! js-top-nav-dropdown-menu"
|
2021-06-08 01:23:25 +05:30
|
|
|
toggle-class="top-nav-toggle js-top-nav-dropdown-toggle gl-px-3!"
|
|
|
|
no-flip
|
2021-09-04 01:27:46 +05:30
|
|
|
no-caret
|
2022-11-25 23:54:43 +05:30
|
|
|
@toggle="trackToggleEvent"
|
2021-06-08 01:23:25 +05:30
|
|
|
>
|
2022-10-11 01:57:18 +05:30
|
|
|
<template #button-content>
|
|
|
|
<gl-icon name="hamburger" />
|
|
|
|
<span v-if="navData.menuTitle" class="gl-ml-3">
|
|
|
|
{{ navData.menuTitle }}
|
|
|
|
</span>
|
|
|
|
</template>
|
2021-06-08 01:23:25 +05:30
|
|
|
<gl-dropdown-form>
|
|
|
|
<top-nav-dropdown-menu
|
|
|
|
:primary="navData.primary"
|
|
|
|
:secondary="navData.secondary"
|
|
|
|
:views="navData.views"
|
|
|
|
/>
|
|
|
|
</gl-dropdown-form>
|
|
|
|
</gl-nav-item-dropdown>
|
|
|
|
</gl-nav>
|
|
|
|
</template>
|