-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
44 lines (35 loc) · 1.24 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import Alpine from 'alpinejs';
import tippy from 'tippy.js';
import { sidebar } from './components/sidebar';
import { darkmode } from './components/darkmode';
import { actionsDropdown } from './components/actionsDropdown';
// CSS TippyJS
import 'tippy.js/dist/tippy.css';
import './tippy-custom-theme.css'
window.tippy = tippy;
window.Alpine = Alpine;
document.addEventListener('alpine:init', () => {
Alpine.data('sidebar', sidebar);
Alpine.data('darkmode', darkmode);
Alpine.data('actionsDropdown', actionsDropdown);
});
Alpine.start();
document.addEventListener('DOMContentLoaded', () => {
const templateTooltipMessahes = document.querySelector('#templateTooltipMessahes');
const templatePopoverNotifications = document.querySelector('#templatePopoverNotifications');
if (templateTooltipMessahes) {
tippy('#messages-notify', {
content: templateTooltipMessahes.innerHTML,
allowHTML: true,
});
}
if (templatePopoverNotifications) {
tippy('#notifications', {
content: templatePopoverNotifications.innerHTML,
allowHTML: true,
theme: 'custom',
interactive: true,
trigger: 'click',
});
}
});