PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.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 All 81 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.14.0, at assets/build/blocks/flip-box/view.js

2 lines 1.3 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(t,e,o="ablocksInitialized"){t&&("function"==typeof t.forEach?t:[t]).forEach(t=>{t&&t.dataset&&!t.dataset[o]&&(t.dataset[o]="1",e(t))})}(document.querySelectorAll(".ablocks-block--flip-box"),t=>{(t=>{const e=t.children[0];if(!e)return;const o=!!document.querySelector(".ablocks-is-fse-theme"),i=e.querySelectorAll(".ablocks-block--flip-box-child");if(!i||i.length<2)return t.style.pointerEvents="none",void(t.style.cursor="default");const l=i[0].children[0],n=i[1].children[0],a=t.querySelectorAll(".ablocks-block--flip-box-child");let s=0;a.forEach(t=>{const e=t.offsetWidth;e>s&&(s=e)});const c=l.offsetHeight,d=n.offsetHeight,h=Math.max(c,d),r=l.offsetWidth,f=n.offsetWidth,p=Math.max(r,f),u=Math.max(p,s);if(o){const t=l.offsetHeight-l.clientHeight,e=l.offsetWidth-l.clientWidth,o=(t,e="vertical")=>{const o=window.getComputedStyle(t)
2 ;return"vertical"===e?parseInt(o.paddingTop)+parseInt(o.paddingBottom):parseInt(o.paddingLeft)+parseInt(o.paddingRight)},i=o(l,"vertical"),a=o(n,"vertical"),s=Math.max(i,a),c=o(l,"horizontal"),d=o(n,"horizontal"),r=Math.max(c,d),f=(o,i,l)=>{o.style.height=`${h-t-s+i}px`,o.style.width=`${u-e-r+l}px`};f(l,s-i,r-c),f(n,s-a,r-d)}else l.style.height=`${h}px`,n.style.height=`${h}px`,l.style.width=`${u}px`,n.style.width=`${u}px`})(t)},"ablocksFlipBoxInit")})})();