Files
NodeBB/public/src/client/notifications.js
2023-07-27 10:53:15 -04:00

24 lines
682 B
JavaScript

'use strict';
define('forum/notifications', ['components', 'notifications'], function (components, notifications) {
const Notifications = {};
Notifications.init = function () {
const listEl = $('.notifications-list');
listEl.on('click', '[component="notifications/item/link"]', function () {
const nid = $(this).parents('[data-nid]').attr('data-nid');
notifications.markNotification(nid, true);
});
notifications.handleUnreadButton(listEl);
components.get('notifications/mark_all').on('click', function () {
notifications.markAllRead(function () {
components.get('notifications/item').removeClass('unread');
});
});
};
return Notifications;
});