/** 
 * Developer's Notice:
 * 
 * Note: JS in this file (and this file itself) is not garunteed backwards compatibility. JS can be added, changed or removed at any time without notice.
 * For more information see the `Backwards Compatibility Guidelines for Developers` section of the README.md file.
 */
jQuery(document).ready(function () {
	jQuery('#monsterinsights_refresh').on('click', function () {
		jQuery(this).html(monsterinsights_pro_reports.monsterinsights_loading + '...');
		jQuery(this).attr('disabled', 'disabled');
		jQuery(this).css('padding-top', '0');

		jQuery.post(
			ajaxurl,
			{
				action  : 'monsterinsights_refresh_data',
				security: monsterinsights_pro_reports.monsterinsights_reports_nonce
			},
			function (response) {
				location.reload();
			}
		);
	});
});