/**
 * Rating Notice JavaScript
 *
 * @package pawwell
 */

(function($) {
	'use strict';

	$(document).ready(function() {

		$(document).on('click', '.pawwell-rating-notice .notice-dismiss', function(e) {
			e.preventDefault();
			$(document).find('.pawwell-rating-notice').slideUp();
			$.post({
				url: pawwell_rating.ajax_url,
				data: {
					action: 'pawwell_rating_dismiss_notice',
					nonce: pawwell_rating.nonce,
				}
			});
		});

		$(document).on('click', '.pawwell-maybe-later', function() {
			$(document).find('.pawwell-rating-notice').slideUp();
			$.post({
				url: pawwell_rating.ajax_url,
				data: {
					action: 'pawwell_rating_maybe_later',
					nonce: pawwell_rating.nonce,
				}
			});
		});

		$(document).on('click', '.pawwell-already-rated', function() {
			$(document).find('.pawwell-rating-notice').slideUp();
			$.post({
				url: pawwell_rating.ajax_url,
				data: {
					action: 'pawwell_rating_already_rated',
					nonce: pawwell_rating.nonce,
				}
			});
		});

	});

})(jQuery);
