]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/Resources/static/themes/material/index.js
changes and default actions
[github/wallabag/wallabag.git] / 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;
   });
 });