|
@@ -114,8 +114,6 @@ function randomString(length = 16) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener('alpine:init', () => {
|
|
document.addEventListener('alpine:init', () => {
|
|
|
- const token = document.querySelector('#token').getAttribute('token');
|
|
|
|
|
-
|
|
|
|
|
// Sticky class helper
|
|
// Sticky class helper
|
|
|
window.addEventListener('scroll', () => {
|
|
window.addEventListener('scroll', () => {
|
|
|
const toolbar = document.querySelector('.toolbar');
|
|
const toolbar = document.querySelector('.toolbar');
|
|
@@ -188,6 +186,7 @@ document.addEventListener('alpine:init', () => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async list() {
|
|
async list() {
|
|
|
|
|
+ const token = document.querySelector('#token').getAttribute('token');
|
|
|
const res = await fetch(`/list/notifications/?ajax=1&token=${token}`);
|
|
const res = await fetch(`/list/notifications/?ajax=1&token=${token}`);
|
|
|
this.initialized = true;
|
|
this.initialized = true;
|
|
|
if (!res.ok) {
|
|
if (!res.ok) {
|
|
@@ -200,6 +199,7 @@ document.addEventListener('alpine:init', () => {
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
async remove(id) {
|
|
async remove(id) {
|
|
|
|
|
+ const token = document.querySelector('#token').getAttribute('token');
|
|
|
await fetch(`/delete/notification/?delete=1¬ification_id=${id}&token=${token}`);
|
|
await fetch(`/delete/notification/?delete=1¬ification_id=${id}&token=${token}`);
|
|
|
|
|
|
|
|
this.notifications = this.notifications.filter((notification) => notification.ID != id);
|
|
this.notifications = this.notifications.filter((notification) => notification.ID != id);
|
|
@@ -208,6 +208,7 @@ document.addEventListener('alpine:init', () => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async removeAll() {
|
|
async removeAll() {
|
|
|
|
|
+ const token = document.querySelector('#token').getAttribute('token');
|
|
|
await fetch(`/delete/notification/?delete=1&token=${token}`);
|
|
await fetch(`/delete/notification/?delete=1&token=${token}`);
|
|
|
|
|
|
|
|
this.notifications = [];
|
|
this.notifications = [];
|