diff --git a/www/common/notifications.js b/www/common/notifications.js
index de9f56a81..7f6070cf2 100644
--- a/www/common/notifications.js
+++ b/www/common/notifications.js
@@ -10,8 +10,10 @@ define([
var defaultDismiss = function (common, data) {
return function (e) {
- e.preventDefault();
- e.stopPropagation();
+ if (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ }
common.mailbox.dismiss(data, function (err) {
if (err) { return void console.error(err); }
});
diff --git a/www/common/sframe-common-mailbox.js b/www/common/sframe-common-mailbox.js
index c21af2f16..032d63a87 100644
--- a/www/common/sframe-common-mailbox.js
+++ b/www/common/sframe-common-mailbox.js
@@ -93,7 +93,6 @@ define([
var el;
if (data.type === 'notifications') {
Notifications.add(Common, data);
- console.log(data);
el = createElement(data);
}
f(data, el);
diff --git a/www/notifications/inner.js b/www/notifications/inner.js
index bb998a44e..a953b796f 100644
--- a/www/notifications/inner.js
+++ b/www/notifications/inner.js
@@ -36,59 +36,81 @@ define([
'cp-notifications-all',
],
'friends': [
- 'cp-notifications-friend-requests',
+ 'cp-notifications-friends',
],
'pads': [
- 'cp-notifications-shared-app',
+ 'cp-notifications-pads',
],
};
var create = {};
- var makeBlock = function (key, addButton) {
- // Convert to camlCase for translation keys
+ // create the list of notifications
+ // show only notifs with type in filterTypes array. If filterTypes empty, don't filter.
+ var makeNotificationList = function (key, filterTypes) {
+ filterTypes = filterTypes || [];
var safeKey = key.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
+ var categoryName = Messages['notification_cat_' + safeKey] || safeKey;
+ var notifsData = [];
var $div = $('
', {'class': 'cp-notifications-' + key + ' cp-sidebarlayout-element'});
- $('