]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
changes and default actions
authorThomas Citharel <tcit@tcit.fr>
Mon, 15 May 2017 08:15:39 +0000 (10:15 +0200)
committerThomas Citharel <tcit@tcit.fr>
Fri, 23 Jun 2017 08:04:18 +0000 (10:04 +0200)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
app/Resources/static/themes/material/index.js

index e16749f6d9c310f522324ab04b237bf8847c72fa..ba4552b80e922d354151e3b946a9aa9367c570bb 100755 (executable)
@@ -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;
   });
 });