Skip to content

Instantly share code, notes, and snippets.

@squill
Created May 16, 2019 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squill/3d29a0c13a6eac3a8d150387497b521f to your computer and use it in GitHub Desktop.
Save squill/3d29a0c13a6eac3a8d150387497b521f to your computer and use it in GitHub Desktop.
Uncaught SyntaxError: Unexpected token =>
~/wp-content/plugins/atomic-blocks/dist/assets/js/dismiss.js?ver=1556813107:6
When that is put into a browser, it gives this:
(function($) {
$(document).ready(function() {
const elems = document.querySelectorAll('.ab-block-notice.ab-dismissable[data-id]');
elems.forEach(el => {
const uid = el.getAttribute( 'data-id' );
if ( ! localStorage.getItem(`notice-${uid}`) ) {
el.style.display = 'block';
}
if ( $( '.ab-notice-dismiss' ).length ) {
el.querySelector('.ab-notice-dismiss').addEventListener('click', () => {
localStorage.setItem(`notice-${uid}`, 1);
el.style.display = '';
})
}
})
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment