mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 12:16:54 +02:00
fix: close notif drawer on item click, fix crash in module
This commit is contained in:
@@ -43,13 +43,13 @@ define('notifications', [
|
|||||||
app.parseAndTranslate('partials/notifications_list', { notifications }, function (html) {
|
app.parseAndTranslate('partials/notifications_list', { notifications }, function (html) {
|
||||||
notifList.html(html);
|
notifList.html(html);
|
||||||
notifList.off('click').on('click', '[component="notifications/item/link"]', function (ev) {
|
notifList.off('click').on('click', '[component="notifications/item/link"]', function (ev) {
|
||||||
const notifEl = $(this);
|
const notifEl = $(this).parents('[data-nid]');
|
||||||
if (scrollToPostIndexIfOnPage(notifEl)) {
|
if (scrollToPostIndexIfOnPage(notifEl)) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
if (triggerEl) {
|
}
|
||||||
triggerEl.dropdown('toggle');
|
if (triggerEl) {
|
||||||
}
|
triggerEl.dropdown('toggle');
|
||||||
}
|
}
|
||||||
|
|
||||||
const unread = notifEl.hasClass('unread');
|
const unread = notifEl.hasClass('unread');
|
||||||
@@ -61,6 +61,7 @@ define('notifications', [
|
|||||||
});
|
});
|
||||||
components.get('notifications').on('click', '.mark-all-read', () => {
|
components.get('notifications').on('click', '.mark-all-read', () => {
|
||||||
Notifications.markAllRead();
|
Notifications.markAllRead();
|
||||||
|
triggerEl.dropdown('toggle');
|
||||||
});
|
});
|
||||||
components.get('notifications').on('click', `[href="${config.relative_path}/notifications"]`, () => {
|
components.get('notifications').on('click', `[href="${config.relative_path}/notifications"]`, () => {
|
||||||
triggerEl.dropdown('toggle');
|
triggerEl.dropdown('toggle');
|
||||||
|
|||||||
Reference in New Issue
Block a user