Files
branddefense.pl/wp-content/plugins/cookie-notice/js/admin-notice.js
Roman Pyrih c2e100a763 first commit
2023-07-24 08:30:51 +02:00

29 lines
693 B
JavaScript

( function( $ ) {
// ready event
$( function() {
// Save dismiss state // .is-dismissible
$( '.cn-notice' ).on( 'click', '.notice-dismiss, .cn-notice-dismiss', function( e ) {
if ( $( e.currentTarget ).hasClass( 'cn-approve' ) )
var notice_action = 'approve';
else if ( $( e.currentTarget ).hasClass( 'cn-delay' ) )
var notice_action = 'delay';
else
var notice_action = 'dismiss';
$.ajax( {
url: cnArgsNotice.ajaxURL,
type: 'POST',
dataType: 'json',
data: {
action: 'cn_dismiss_notice',
notice_action: notice_action,
nonce: cnArgsNotice.nonce
}
} );
$( e.delegateTarget ).slideUp( 'fast' );
} );
} );
} )( jQuery );