FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
packages
/
blocks-next
/
build
/
scripts
/
dialog
Edit File: index.js
import*as e from"@wordpress/interactivity";var t,o,n={d:function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},r=(t={getContext:function(){return e.getContext},getElement:function(){return e.getElement},store:function(){return e.store}},o={},n.d(o,t),o);(0,r.store)("surecart/dialog",{actions:{toggle:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const{target:t}=(0,r.getContext)()||{};let o=document.querySelector(e??t??null);if(!o){const{ref:e}=(0,r.getElement)();o=e.parentElement.querySelector("dialog")||e.closest("dialog")||null}o instanceof HTMLDialogElement!=0&&(o?.open?o?.close():o?.showModal(),o?.open?document.body.classList.add("sc-scroll-lock"):document.body.classList.remove("sc-scroll-lock"))},closeOverlay:e=>{e.target===e.currentTarget&&(e.currentTarget.close(),document.body.classList.remove("sc-scroll-lock"))}}});
Save
Back