wp_back/wp-content/plugins/visual-portfolio/build/assets/js/layout-masonry.js
2024-05-20 15:37:46 +03:00

1 line
1.0 KiB
JavaScript

!function(){"use strict";var o={n:function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(t,{a:t}),t},d:function(n,t){for(var e in t)o.o(t,e)&&!o.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},o:function(o,n){return Object.prototype.hasOwnProperty.call(o,n)}},n=window.jQuery,t=o.n(n);const{screenSizes:e}=window.VPData;t()(document).on("initOptions.vpf",((o,n)=>{"vpf"===o.namespace&&(n.defaults.masonryColumns=3,n.options.masonryColumns||(n.options.masonryColumns=n.defaults.masonryColumns),n.options.masonryImagesAspectRatio||(n.options.masonryImagesAspectRatio=n.defaults.masonryImagesAspectRatio))})),t()(document).on("initLayout.vpf",((o,n)=>{if("vpf"!==o.namespace)return;if("masonry"!==n.options.layout)return;n.addStyle(".vp-portfolio__item-wrap",{width:100/n.options.masonryColumns+"%"});let t=n.options.masonryColumns-1,s=Math.min(e.length-1,t);for(;s>=0;s-=1)t>0&&void 0!==e[s]&&n.addStyle(".vp-portfolio__item-wrap",{width:100/t+"%"},`screen and (max-width: ${e[s]}px)`),t-=1}))}();