Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieliser/07e71479187150721afec430ae8c9775 to your computer and use it in GitHub Desktop.
Save danieliser/07e71479187150721afec430ae8c9775 to your computer and use it in GitHub Desktop.
Custom function to pass in a jQuery script to set a cookie via manual JS during 'on_click' trigger event and on form close.
@strarsis
Copy link

strarsis commented Dec 8, 2022

With current Popup Maker plugin I had to use this:

const popupElement = document.querySelector('#pum-<id> or .pum class');
PUM.setCookie(popupElement);
// (or window.PUM)

@danieliser
Copy link
Author

@strarsis the the popupElement you pass in gets passed to PUM.getPopup(). That is a magic function of sorts and will accept an element, a numeric ID #, or a selector. So you could probably shortcut and just do PUM.setCookie(<id>) similar to the example aboves PUM.close(1483)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment