mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-08 23:57:27 +01:00
24 lines
682 B
JavaScript
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;
|
|
});
|