diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /app/assets/javascripts/header.js | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'app/assets/javascripts/header.js')
-rw-r--r-- | app/assets/javascripts/header.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/header.js b/app/assets/javascripts/header.js index 4d03a523486..f58781fa9ec 100644 --- a/app/assets/javascripts/header.js +++ b/app/assets/javascripts/header.js @@ -1,7 +1,9 @@ import Vue from 'vue'; +import NewNavToggle from '~/nav/components/new_nav_toggle.vue'; import { highCountTrim } from '~/lib/utils/text_utility'; import Tracking from '~/tracking'; import Translate from '~/vue_shared/translate'; +import { parseBoolean } from '~/lib/utils/common_utils'; /** * Updates todo counter when todos are toggled. @@ -99,6 +101,7 @@ function trackShowUserDropdownLink(trackEvent, elToTrack, el) { }); }); } + export function initNavUserDropdownTracking() { const el = document.querySelector('.js-nav-user-dropdown'); const buyEl = document.querySelector('.js-buy-pipeline-minutes-link'); @@ -108,5 +111,23 @@ export function initNavUserDropdownTracking() { } } +function initNewNavToggle() { + const el = document.querySelector('.js-new-nav-toggle'); + if (!el) return false; + + return new Vue({ + el, + render(h) { + return h(NewNavToggle, { + props: { + enabled: parseBoolean(el.dataset.enabled), + endpoint: el.dataset.endpoint, + }, + }); + }, + }); +} + requestIdleCallback(initStatusTriggers); requestIdleCallback(initNavUserDropdownTracking); +requestIdleCallback(initNewNavToggle); |