| 1 |
(function($) { |
| 2 |
|
| 3 |
jQuery(document).on( 'click', '.sh4-skip-notifications input[type=checkbox]', function(event) |
| 4 |
{ |
| 5 |
var $this = jQuery(this); |
| 6 |
var $form = $this.closest('form'); |
| 7 |
var action = $form.attr('action'); |
| 8 |
|
| 9 |
hc2_set_loader( $form ); |
| 10 |
|
| 11 |
jQuery.ajax({ |
| 12 |
type: 'POST', |
| 13 |
url: action, |
| 14 |
data: $form.serialize(), |
| 15 |
success: function(data, textStatus){ |
| 16 |
hc2_unset_loader( $form ); |
| 17 |
} |
| 18 |
}) |
| 19 |
.fail( function(jqXHR, textStatus, errorThrown){ |
| 20 |
hc2_unset_loader( $form ); |
| 21 |
alert( 'Ajax Error' ); |
| 22 |
console.log( 'Ajax Error: ' + errorThrown + "\n" + jqXHR.responseText ); |
| 23 |
location.reload(); |
| 24 |
}) |
| 25 |
; |
| 26 |
}); |
| 27 |
|
| 28 |
}()); |
| 29 |
|