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>2020-12-03 21:10:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-03 21:10:10 +0300
commitc2a6cc86754adb3c5e064cebc58d206a52cb412e (patch)
tree3960c9ae2590e89e25193a0006e84d06f900e378 /app/assets/javascripts/layout_nav.js
parentbbd9e2c915c46920ceb51376db19599cbf9ba836 (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.js29
1 files changed, 11 insertions, 18 deletions
diff --git a/app/assets/javascripts/layout_nav.js b/app/assets/javascripts/layout_nav.js
index 4d2955a8d3d..ab83f1ecc14 100644
--- a/app/assets/javascripts/layout_nav.js
+++ b/app/assets/javascripts/layout_nav.js
@@ -1,6 +1,7 @@
import $ from 'jquery';
import ContextualSidebar from './contextual_sidebar';
import initFlyOutNav from './fly_out_nav';
+import { setNotification } from './whats_new/utils/notification';
function hideEndFade($scrollingTabs) {
$scrollingTabs.each(function scrollTabsLoop() {
@@ -14,25 +15,17 @@ function hideEndFade($scrollingTabs) {
function initDeferred() {
$(document).trigger('init.scrolling-tabs');
- const whatsNewTriggerEl = document.querySelector('.js-whats-new-trigger');
- if (whatsNewTriggerEl) {
- const storageKey = whatsNewTriggerEl.getAttribute('data-storage-key');
+ const appEl = document.getElementById('whats-new-app');
+ if (!appEl) return;
- $('.header-help').on('show.bs.dropdown', () => {
- const displayNotification = JSON.parse(localStorage.getItem(storageKey));
- if (displayNotification === false) {
- $('.js-whats-new-notification-count').remove();
- }
- });
-
- whatsNewTriggerEl.addEventListener('click', () => {
- import(/* webpackChunkName: 'whatsNewApp' */ '~/whats_new')
- .then(({ default: initWhatsNew }) => {
- initWhatsNew();
- })
- .catch(() => {});
- });
- }
+ setNotification(appEl);
+ document.querySelector('.js-whats-new-trigger').addEventListener('click', () => {
+ import(/* webpackChunkName: 'whatsNewApp' */ '~/whats_new')
+ .then(({ default: initWhatsNew }) => {
+ initWhatsNew(appEl);
+ })
+ .catch(() => {});
+ });
}
export default function initLayoutNav() {