/**
 * Rating Notice JavaScript
 *
 * @package shop-zen
 */

(function($) {
	'use strict';

	$(document).ready(function() {

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

		$(document).on('click', '.shop-zen-maybe-later', function() {
			$(document).find('.shop-zen-rating-notice').slideUp();
			$.post({
				url: shop_zen_rating.ajax_url,
				data: {
					action: 'shop_zen_rating_maybe_later',
					nonce: shop_zen_rating.nonce,
				}
			});
		});

		$(document).on('click', '.shop-zen-already-rated', function() {
			$(document).find('.shop-zen-rating-notice').slideUp();
			$.post({
				url: shop_zen_rating.ajax_url,
				data: {
					action: 'shop_zen_rating_already_rated',
					nonce: shop_zen_rating.nonce,
				}
			});
		});

	});

})(jQuery);
