tzcm.js
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
(function ($) {
$(document).ready(
function () {
$('.date-filter').on(
'change', function () {
$(this).closest('form').submit();
$(this).closest('.column').find('.spinner').first().css({display: 'inline-block'});
}
);
function campaignMonitor() {
$('a.campaign').click(
function (e) {
e.preventDefault();
var url = "/app/plugins/tenzing-campaign-monitor/campaignRetriever.php" + "?" + "campaignURL=" + $(this).data('url'); //
var myWindow = window.open(url, "MsgWindow", "width=650, height=800");
}
);
}
$('.year-sync').on('click', function(e) {
var _this = this;
// Disable other buttons
$('.year-sync').prop('disabled', true);
$(_this).find('img').show();
var year = $(this).attr('data-value');
var data = {
'action': 'load_campaign_data',
'year': year
};
$.post(ajaxurl, data, function(response) {
$('.year-sync').prop('disabled', false);
$(_this).find('img').hide();
location.reload();
});
});
}
);
})(jQuery);