debian-mirror-gitlab/app/assets/javascripts/notifications/index.js

47 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-03-11 19:13:27 +05:30
import { GlToast } from '@gitlab/ui';
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import NotificationsDropdown from './components/notifications_dropdown.vue';
Vue.use(GlToast);
export default () => {
const containers = document.querySelectorAll('.js-vue-notification-dropdown');
if (!containers.length) return false;
return containers.forEach((el) => {
const {
containerClass,
buttonSize,
disabled,
dropdownItems,
notificationLevel,
helpPagePath,
projectId,
groupId,
showLabel,
2022-04-04 11:22:00 +05:30
noFlip,
2021-03-11 19:13:27 +05:30
} = el.dataset;
return new Vue({
el,
provide: {
containerClass,
buttonSize,
disabled: parseBoolean(disabled),
dropdownItems: JSON.parse(dropdownItems),
initialNotificationLevel: notificationLevel,
helpPagePath,
projectId,
groupId,
showLabel: parseBoolean(showLabel),
2022-04-04 11:22:00 +05:30
noFlip: parseBoolean(noFlip),
2021-03-11 19:13:27 +05:30
},
render(h) {
return h(NotificationsDropdown);
},
});
});
};