AlkantarClanX12
Current Path : /home/thanudqk/thepball.com/wp-content/plugins/wp-smushit/_src/js/ |
Current File : //home/thanudqk/thepball.com/wp-content/plugins/wp-smushit/_src/js/global.js |
/* global ajaxurl */ document.addEventListener( 'DOMContentLoaded', function() { const dismissNoticeBtn = document.getElementById( 'smush-dismiss-conflict-notice' ); if ( dismissNoticeBtn ) { dismissNoticeBtn.addEventListener( 'click', dismissNotice ); } const dismissNoticeTop = document.querySelector( '#smush-conflict-notice > .notice-dismiss' ); if ( dismissNoticeTop ) { dismissNoticeTop.addEventListener( 'click', dismissNotice ); } function dismissNotice() { const xhr = new XMLHttpRequest(); xhr.open( 'POST', ajaxurl + '?action=dismiss_check_for_conflicts', true ); xhr.onload = () => { const btn = document.querySelector( '#smush-conflict-notice > button.notice-dismiss' ); if ( btn ) { btn.click(); } }; xhr.send(); } } );