Sindbad~EG File Manager

Current Path : /home/frekansk/.trash/wp-content/plugins/learnpress/assets/src/js/admin/share/
Upload File :
Current File : /home/frekansk/.trash/wp-content/plugins/learnpress/assets/src/js/admin/share/admin-notice.js

( function( $ ) {
	const dismissNotice = function dismissNotice( notice, options ) {
		const hooks = wp.hooks;

		options = $.extend( { el: null }, options || {} );

		hooks && hooks.doAction( 'before-dismiss-notice', 'LP', notice, options );
		$.ajax( {
			url: '',
			data: $.extend( { 'lp-dismiss-notice': notice }, options.data || {} ),
			dataType: 'text',
			success: ( response ) => {
				response = LP.parseJSON( response );

				if ( response.dismissed === notice ) {
					$( options.el ).fadeOut();
				}

				hooks && hooks.doAction( 'dismissed-notice', 'LP', notice, options );
			},
		} );
	};

	$( document ).on( 'click', '.lp-notice [data-dismiss-notice]', function() {
		const data = $( this ).data();
		const notice = data.dismissNotice;

		delete data.dismissNotice;

		dismissNotice( notice, { data, el: $( this ).closest( '.lp-notice' ) } );
	} );
}( jQuery ) );

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists