From d6d3f4ec3698effd1d4b063e295341791bdcf7d7 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 15 May 2017 10:15:39 +0200 Subject: changes and default actions Signed-off-by: Thomas Citharel --- app/Resources/static/themes/material/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index e16749f6..ba4552b8 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js @@ -77,12 +77,12 @@ $(document).ready(() => { $('.progress .determinate').css('width', `${scrollPercent}%`); }); - $('.notification').on('click', () => { - $.ajax({ - url: Routing.generate('notification-archive-all'), - method: 'GET', - }).done(() => { + $('.notification .notification-action').on('click', (e) => { + const id = parseInt($(e.target).attr('data-id'), 10); + fetch(Routing.generate('notification-archive', { notification: id }), { credentials: 'same-origin' }).then(() => { + $(e.target).parents('.notification').removeClass('light-blue lighten-5'); $('#notifications').sideNav('hide'); }); + return true; }); }); -- cgit v1.2.3