PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.9.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.9.0
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / assets / build / blocks / flip-box / view.js

view.js in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.9.0, at assets/build/blocks/flip-box/view.js

1 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";document.addEventListener("DOMContentLoaded",()=>{!function(){const t=document.querySelectorAll(".ablocks-block--flip-box");t.length&&t.forEach(t=>{(t=>{const e=t.children[0];if(!e)return;const o=!!document.querySelector(".ablocks-is-fse-theme"),l=e.querySelectorAll(".ablocks-block--flip-box-child");if(!l||l.length<2)return t.style.pointerEvents="none",void(t.style.cursor="default");const i=l[0].children[0],n=l[1].children[0],s=t.querySelectorAll(".ablocks-block--flip-box-child");let c=0;s.forEach(t=>{const e=t.offsetWidth;e>c&&(c=e)});const h=i.offsetHeight,r=n.offsetHeight,a=Math.max(h,r),d=i.offsetWidth,f=n.offsetWidth,p=Math.max(d,f),g=Math.max(p,c);if(o){const t=i.offsetHeight-i.clientHeight,e=i.offsetWidth-i.clientWidth,o=(t,e="vertical")=>{const o=window.getComputedStyle(t);return"vertical"===e?parseInt(o.paddingTop)+parseInt(o.paddingBottom):parseInt(o.paddingLeft)+parseInt(o.paddingRight)},l=o(i,"vertical"),s=o(n,"vertical"),c=Math.max(l,s),h=o(i,"horizontal"),r=o(n,"horizontal"),d=Math.max(h,r),f=(o,l,i)=>{o.style.height=`${a-t-c+l}px`,o.style.width=`${g-e-d+i}px`};f(i,c-l,d-h),f(n,c-s,d-r)}else i.style.height=`${a}px`,n.style.height=`${a}px`,i.style.width=`${g}px`,n.style.width=`${g}px`})(t)})}()})})();