|
|
|
@ -2,8 +2,7 @@ define(function() {
|
|
|
|
|
var Notifications = {};
|
|
|
|
|
|
|
|
|
|
Notifications.init = function() {
|
|
|
|
|
var listEl = $('.notifications-list'),
|
|
|
|
|
markAllReadEl = document.getElementById('mark-all-notifs-read');
|
|
|
|
|
var listEl = $('.notifications-list');
|
|
|
|
|
|
|
|
|
|
$('span.timeago').timeago();
|
|
|
|
|
|
|
|
|
@ -11,20 +10,6 @@ define(function() {
|
|
|
|
|
listEl.on('click', 'li', function(e) {
|
|
|
|
|
this.querySelector('a').click();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Mark all as read button
|
|
|
|
|
$(markAllReadEl).click(function() {
|
|
|
|
|
socket.emit('api:modules.notifications.mark_all_read', {}, function() {
|
|
|
|
|
ajaxify.go('notifications');
|
|
|
|
|
app.alert({
|
|
|
|
|
alert_id: "notifications:mark_all_read",
|
|
|
|
|
title: "All Notifications Read",
|
|
|
|
|
message: "Successfully marked all notifications read",
|
|
|
|
|
type: 'success',
|
|
|
|
|
timeout: 2500
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Notifications;
|
|
|
|
|