diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read.js b/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read.js index 82a118f77..9788ca82a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read.js +++ b/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read.js @@ -26,13 +26,25 @@ window.addEventListener('DOMContentLoaded', function (e) { buttonNoText: 'false' === el.dataset.buttonText, showUrl: el.dataset.showButtonUrl, isRead: 1 === +el.dataset.notificationCurrentIsRead, + container: el.dataset.container + } + }, + computed: { + getContainer() { + return document.getElementById(this.container); } }, methods: { onMarkRead() { + if (null !== this.getContainer) { + this.getContainer.classList.replace('read', 'unread'); + } this.isRead = false; }, onMarkUnread() { + if (null !== this.getContainer) { + this.getContainer.classList.replace('unread', 'read'); + } this.isRead = true; }, } @@ -40,4 +52,4 @@ window.addEventListener('DOMContentLoaded', function (e) { .use(i18n) .mount(el); }); -}) +}); diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig index 4b9b69c30..710bb00ae 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig @@ -1,4 +1,4 @@ -
+
{# TODO pagination or limit #} {% for notification in notifications %} -
+
{% if not notification.isSystem %} {% if notification.sender == app.user %} @@ -17,6 +17,7 @@