1 line
1.2 KiB
JavaScript
1 line
1.2 KiB
JavaScript
!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.jQuery,n=e.n(t);const a=n()("body"),o=n()(document),r=n()("#vp_preview");document.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),window.parentIFrame&&window.parentIFrame.sendMessage("clicked")}),!0),document.addEventListener("mousedown",(e=>{e.stopPropagation(),e.preventDefault(),e.target.blur(),window.focus()}),!0),o.on("startLoadingNewItems.vpf",((e,t,n,a)=>{"vpf"===e.namespace&&(a.data=Object.assign(a.data||{},window.vp_preview_post_data))}));const s={};window.iFrameResizer={log:!1,heightCalculationMethod(){return r.outerHeight(!0)},onMessage(e){if(e&&e.name)switch(e.name){case"resize":a.css("max-width",e.width+Math.random());break;case"dynamic-css":{const t=`vp-dynamic-styles-${e.blockId}-inline-css`;if(s[t]&&e.styles===s[t])break;let a=n()(`#${t}`);a.length||(a=n()(`<style id="${t}"></style>`).appendTo("head")),s[t]=e.styles,a.text(e.styles);break}}}}}(); |