Advertisement
Guest User

Untitled

a guest
May 26th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. ~/wp-content/plugins/atomic-blocks/dist/assets/js/dismiss.js?ver=1556813107:6
  2.  
  3. When that is put into a browser, it gives this:
  4.  
  5. (function($) {
  6.  
  7. $(document).ready(function() {
  8.  
  9. const elems = document.querySelectorAll('.ab-block-notice.ab-dismissable[data-id]');
  10. elems.forEach(el => {
  11. const uid = el.getAttribute( 'data-id' );
  12. if ( ! localStorage.getItem(`notice-${uid}`) ) {
  13. el.style.display = 'block';
  14. }
  15.  
  16. if ( $( '.ab-notice-dismiss' ).length ) {
  17. el.querySelector('.ab-notice-dismiss').addEventListener('click', () => {
  18. localStorage.setItem(`notice-${uid}`, 1);
  19. el.style.display = '';
  20. })
  21. }
  22. })
  23.  
  24. });
  25.  
  26. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement