(function ($) {
	'use strict';

	$(document).on('click', '.nova-photography-portfolio-notice-wrapper .notice-dismiss', function () {
		var $notice = $(this).closest('.nova-photography-portfolio-notice-wrapper');
		var noticeId = $notice.data('notice');

		$.ajax({
			type: 'POST',
			url: nova_photography_portfolio_localize.ajax_url,
			data: {
				action: 'nova_photography_portfolio_dismiss_admin_notice',
				notice: noticeId,
				nonce: nova_photography_portfolio_localize.nonce,
			},
			success: function () {
				$notice.fadeOut(300, function () {
					$(this).remove();
				});
			},
		});
	});

	$(document).on('click', '.quick-start-guide-dismiss', function () {
		var $guide = $(this).closest('.quick-start-guide');

		$.ajax({
			type: 'POST',
			url: nova_photography_portfolio_localize.ajax_url,
			data: {
				action: 'nova_photography_portfolio_dismiss_quick_start_guide',
				nonce: nova_photography_portfolio_localize.nonce,
			},
			success: function () {
				$guide.fadeOut(300, function () {
					$(this).remove();
				});
			},
		});
	});
})(jQuery);

