Permalink
Browse files

fix(site_notifications): no ajax error without reason on auto-deletio…

…n of site notifications
  • Loading branch information...
iionly committed Oct 1, 2015
1 parent 5d123ab commit 7aa55a819c0824dc97a5752658260cea6b2f1a2f
Showing with 14 additions and 4 deletions.
  1. +14 −4 mod/site_notifications/views/default/js/site_notifications.php
@@ -48,10 +48,20 @@
* @return void
*/
elgg.site_notifications.auto_delete = function(event) {
- var id = $(this).attr('id');
- id = id.replace("link", "delete");
- elgg.action($('#' + id).attr('href'), {});
-}
+ var href = this.href;
+ var id = this.id.replace("link", "delete");
+
+ require(['elgg/spinner'], function (spinner) {
+ elgg.action($('#' + id).prop('href'), {
+ beforeSend: spinner.start,
+ complete: function() {
+ location.href = href;
+ }
+ });
+ });
+
+ return false;
+};
/**
* Toggle the checkboxes in the site notification listing

0 comments on commit 7aa55a8

Please sign in to comment.