%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/itworks/wp-content/plugins/thim-core/admin/assets/js/
Upload File :
Create Path :
Current File : /var/www/html/itworks/wp-content/plugins/thim-core/admin/assets/js/notifications.js

(function ($) {
	var Thim_Notifications = Backbone.View.extend({
		el: '#wpwrap',

		events: {
			'click .notice-dismiss': 'onDismiss'
		},

		/**
		 * Init notifications.
		 *
		 * @since 0.8.7
		 */
		initialize: function () {
			this.render();
		},

		onDismiss: function (e) {
			var $btn = this.$(e.target);
			var $notification = $btn.closest('.tc-notice');
			$notification.hide();
			var id = $notification.attr('data-id');

			this.request(id)
				.success(function (data) {
					console.info('Hiding successful!');
				})
				.error(function (error) {
					console.error(error);
				});
		},

		request: function (id) {
			return $.ajax({
				method: 'POST',
				url: thim_notifications.ajax,
				data: {id: id},
				dataType: 'json'
			});
		}
	});

	$(document).ready(function () {
		new Thim_Notifications();
	});
})(jQuery);

Zerion Mini Shell 1.0