diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-09 00:08:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-09 00:08:53 +0300 |
commit | 459939f27fe77e90d7ba2b1d6c0aff59ff38e336 (patch) | |
tree | 75e3b4e2242b51f68f1e80f3a0242864e7c0d6a7 /app/assets/javascripts/layout_nav.js | |
parent | ea8492330b51c502b005e60e3a5ff84ec4eea467 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/layout_nav.js')
-rw-r--r-- | app/assets/javascripts/layout_nav.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/assets/javascripts/layout_nav.js b/app/assets/javascripts/layout_nav.js index 0ecf3301250..d7f5e6f8a5e 100644 --- a/app/assets/javascripts/layout_nav.js +++ b/app/assets/javascripts/layout_nav.js @@ -1,7 +1,6 @@ import $ from 'jquery'; import ContextualSidebar from './contextual_sidebar'; import initFlyOutNav from './fly_out_nav'; -import initWhatsNew from '~/whats_new'; function hideEndFade($scrollingTabs) { $scrollingTabs.each(function scrollTabsLoop() { @@ -14,6 +13,17 @@ function hideEndFade($scrollingTabs) { function initDeferred() { $(document).trigger('init.scrolling-tabs'); + + const whatsNewTriggerEl = document.querySelector('.js-whats-new-trigger'); + if (whatsNewTriggerEl) { + whatsNewTriggerEl.addEventListener('click', () => { + import(/* webpackChunkName: 'whatsNewApp' */ '~/whats_new') + .then(({ default: initWhatsNew }) => { + initWhatsNew(); + }) + .catch(() => {}); + }); + } } export default function initLayoutNav() { @@ -21,7 +31,6 @@ export default function initLayoutNav() { contextualSidebar.bindEvents(); initFlyOutNav(); - initWhatsNew(); // We need to init it on DomContentLoaded as others could also call it $(document).on('init.scrolling-tabs', () => { |