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

1 line
3.0 KiB
JavaScript

!function(){"use strict";var o={n:function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},d:function(e,t){for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:function(o,e){return Object.prototype.hasOwnProperty.call(o,e)}},e=window.jQuery,t=o.n(e),i=function(o){var e=[],t=null,i=function(){for(var i=arguments.length,n=new Array(i),p=0;p<i;p++)n[p]=arguments[p];e=n,t||(t=requestAnimationFrame((function(){t=null,o.apply(void 0,e)})))};return i.cancel=function(){t&&(cancelAnimationFrame(t),t=null)},i};function n(o,e,t){var i,n=t||{},p=n.noTrailing,s=void 0!==p&&p,a=n.noLeading,r=void 0!==a&&a,f=n.debounceMode,u=void 0===f?void 0:f,d=!1,c=0;function v(){i&&clearTimeout(i)}function m(){for(var t=arguments.length,n=new Array(t),p=0;p<t;p++)n[p]=arguments[p];var a=this,f=Date.now()-c;function m(){c=Date.now(),e.apply(a,n)}function l(){i=void 0}d||(r||!u||i||m(),v(),void 0===u&&f>o?r?(c=Date.now(),s||(i=setTimeout(u?l:m,o))):m():!0!==s&&(i=setTimeout(u?l:m,void 0===u?o-f:o)))}return m.cancel=function(o){var e=(o||{}).upcomingOnly,t=void 0!==e&&e;v(),d=!t},m}const{getComputedStyle:p}=window,s=t()(window),a=t()(document),r=["tiles","masonry","grid"];var f;a.on("extendClass.vpf",((o,e)=>{"vpf"===o.namespace&&(e.prototype.initIsotope=function(o){const e=this;if(e.$items_wrap.isotope&&r.includes(e.options.layout)){const t="rtl"===p(e.$items_wrap[0]).direction,i=o||{itemSelector:".vp-portfolio__item-wrap",layoutMode:"masonry",transitionDuration:"0.3s",percentPosition:!0,originLeft:!t,resize:!1};e.emitEvent("beforeInitIsotope",[i]),e.$items_wrap.isotope(i),e.emitEvent("initIsotope",[i])}},e.prototype.destroyIsotope=function(){const o=this;o.$items_wrap.data("isotope")&&(o.$items_wrap.isotope("destroy"),o.emitEvent("destroyIsotope"))})})),a.on("addItems.vpf",((o,e,t,i)=>{if("vpf"===o.namespace&&e.$items_wrap.data("isotope")){if(i){const o=e.$items_wrap.find(".vp-portfolio__item-wrap");e.$items_wrap.isotope("remove",o),e.$items_wrap.prepend(t).isotope("prepended",t)}else e.$items_wrap.append(t).isotope("appended",t);setTimeout((()=>{e.initIsotope("layout")}),0)}})),a.on("removeItems.vpf",((o,e,t)=>{"vpf"===o.namespace&&e.$items_wrap.data("isotope")&&e.$items_wrap.isotope("remove",t)})),a.on("init.vpf",((o,e)=>{"vpf"===o.namespace&&e.initIsotope()})),a.on("imagesLoaded.vpf",((o,e)=>{"vpf"===o.namespace&&e.initIsotope("layout")})),a.on("destroy.vpf",((o,e)=>{"vpf"===o.namespace&&e.destroyIsotope()})),a.on("initEvents.vpf",((o,e)=>{if("vpf"===o.namespace&&e.$items_wrap.isotope&&r.includes(e.options.layout)){const o=`.vpf-uid-${e.uid}`;s.on(`resize${o}`,n(100,i((()=>{e.initIsotope("layout")}))))}})),a.on("destroyEvents.vpf",((o,e)=>{if("vpf"===o.namespace&&r.includes(e.options.layout)){const o=`.vpf-uid-${e.uid}`;s.off(`resize${o}`)}})),a.on("vc-full-width-row",(150,n(150,i(((o,e)=>{t()(e).find(".vp-portfolio").each((function(){this.vpf&&this.vpf.initIsotope&&this.vpf.$items_wrap.data("isotope")&&this.vpf.initIsotope("layout")}))})),{debounceMode:!1!==(void 0!==(f={}.atBegin)&&f)})))}();