| 1 |
jQuery(document).ready(function($) { |
| 2 |
|
| 3 |
$('.maxbuttons-notice [data-action], .maxbuttons-reviewoffer [data-action]').on('click', mb_review_init_ajax); |
| 4 |
|
| 5 |
function mb_review_init_ajax (e) |
| 6 |
{ |
| 7 |
e.preventDefault; |
| 8 |
|
| 9 |
var new_status = $(e.target).data('action'); |
| 10 |
mb_review_ajax(new_status); |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
} |
| 15 |
|
| 16 |
function mb_review_ajax(new_status) |
| 17 |
{ |
| 18 |
var url = mb_ajax_review.ajaxurl; |
| 19 |
var data = { action: 'set_review_notice_status', |
| 20 |
status : new_status |
| 21 |
}; |
| 22 |
|
| 23 |
$.ajax({ |
| 24 |
method: "POST", |
| 25 |
url: url, |
| 26 |
data: data, |
| 27 |
success: function (res) |
| 28 |
{ |
| 29 |
mb_review_done(); |
| 30 |
}, |
| 31 |
|
| 32 |
}); |
| 33 |
|
| 34 |
} |
| 35 |
|
| 36 |
function mb_review_done() |
| 37 |
{ |
| 38 |
$('.maxbuttons-notice, .maxbuttons-reviewoffer').fadeOut(); |
| 39 |
|
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
}); /* END OF JQUERY */ |
| 44 |
|