diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-09 15:09:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-09 15:09:29 +0000 |
commit | 209bd8cf1f542f6ba2a069b368a9187faa871e96 (patch) | |
tree | 6b77dc8183135b8316cc70c8dbc9c4e7c18cf05a /app/assets/javascripts/header.js | |
parent | a9ced7da447785c57477b3d8dbccc73a78cface1 (diff) | |
download | gitlab-ce-209bd8cf1f542f6ba2a069b368a9187faa871e96.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/header.js')
-rw-r--r-- | app/assets/javascripts/header.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/assets/javascripts/header.js b/app/assets/javascripts/header.js index fdd27e08793..1678991b1ea 100644 --- a/app/assets/javascripts/header.js +++ b/app/assets/javascripts/header.js @@ -5,6 +5,7 @@ import { highCountTrim } from '~/lib/utils/text_utility'; import SetStatusModalTrigger from './set_status_modal/set_status_modal_trigger.vue'; import SetStatusModalWrapper from './set_status_modal/set_status_modal_wrapper.vue'; import { parseBoolean } from '~/lib/utils/common_utils'; +import Tracking from '~/tracking'; /** * Updates todo counter when todos are toggled. @@ -73,6 +74,24 @@ function initStatusTriggers() { } } +export function initNavUserDropdownTracking() { + const el = document.querySelector('.js-nav-user-dropdown'); + const buyEl = document.querySelector('.js-buy-ci-minutes-link'); + + if (el && buyEl) { + const { trackLabel, trackProperty } = buyEl.dataset; + const trackEvent = 'show_buy_ci_minutes'; + + $(el).on('shown.bs.dropdown', () => { + Tracking.event(undefined, trackEvent, { + label: trackLabel, + property: trackProperty, + }); + }); + } +} + document.addEventListener('DOMContentLoaded', () => { requestIdleCallback(initStatusTriggers); + initNavUserDropdownTracking(); }); |