Viewing File: /home/maglabs/racinepara/wp-content/themes/medilazar/assets/js/sticky-layout.js
function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(function(){var t,e;t=window.jQuery,e=t(window),t.fn.stick_in_parent=function(i){var o,n,r,s,a,c,l,u,p,d,f,h,g;for(null==i&&(i={}),g=i.sticky_class,c=i.inner_scrolling,h=i.recalc_every,f=i.parent,p=i.offset_top,u=i.spacer,r=i.bottoming,null==p&&(p=0),null==f&&(f=void 0),null==c&&(c=!0),null==g&&(g="is_stuck"),o=t(document),null==r&&(r=!0),d=function(t){var e,i;return window.getComputedStyle?(t[0],e=window.getComputedStyle(t[0]),i=parseFloat(e.getPropertyValue("width"))+parseFloat(e.getPropertyValue("margin-left"))+parseFloat(e.getPropertyValue("margin-right")),"border-box"!==e.getPropertyValue("box-sizing")&&(i+=parseFloat(e.getPropertyValue("border-left-width"))+parseFloat(e.getPropertyValue("border-right-width"))+parseFloat(e.getPropertyValue("padding-left"))+parseFloat(e.getPropertyValue("padding-right"))),i):t.outerWidth(!0)},s=function(i,n,s,a,l,y,m,k){var w,v,_,b,C,x,V,P,F,S,H,j;if(!i.data("sticky_kit")){if(i.data("sticky_kit",!0),C=o.height(),V=i.parent(),null!=f&&(V=V.closest(f)),!V.length)throw"failed to find stick parent";if(_=!1,w=!1,H=null!=u?u&&i.closest(u):t("<div />"),H&&H.css("position",i.css("position")),P=function(){var t,e,r;if(!k)return C=o.height(),t=parseInt(V.css("border-top-width"),10),e=parseInt(V.css("padding-top"),10),n=parseInt(V.css("padding-bottom"),10),s=V.offset().top+t+e,a=V.height(),_&&(_=!1,w=!1,null==u&&(i.insertAfter(H),H.detach()),i.css({position:"",top:"",width:"",bottom:""}).removeClass(g),r=!0),l=i.offset().top-(parseInt(i.css("margin-top"),10)||0)-p,y=i.outerHeight(!0),m=i.css("float"),H&&H.css({width:d(i),height:y,display:i.css("display"),"vertical-align":i.css("vertical-align"),float:m}),r?j():void 0},P(),y!==a)return b=void 0,x=p,S=h,j=function(){var t,d,f,v,F,j;if(!k)return f=!1,null!=S&&(S-=1)<=0&&(S=h,P(),f=!0),f||o.height()===C||(P(),f=!0),v=e.scrollTop(),null!=b&&(d=v-b),b=v,_?(r&&(F=v+y+x>a+s,w&&!F&&(w=!1,i.css({position:"fixed",bottom:"",top:x}).trigger("sticky_kit:unbottom"))),v<l&&(_=!1,x=p,null==u&&("left"!==m&&"right"!==m||i.insertAfter(H),H.detach()),t={position:"",width:"",top:""},i.css(t).removeClass(g).trigger("sticky_kit:unstick")),c&&(j=e.height(),y+p>j&&(w||(x-=d,x=Math.max(j-y,x),x=Math.min(p,x),_&&i.css({top:x+"px"}))))):v>l&&(_=!0,t={position:"fixed",top:x},t.width="border-box"===i.css("box-sizing")?i.outerWidth()+"px":i.width()+"px",i.css(t).addClass(g),null==u&&(i.after(H),"left"!==m&&"right"!==m||H.append(i)),i.trigger("sticky_kit:stick")),_&&r&&(null==F&&(F=v+y+x>a+s),!w&&F)?(w=!0,"static"===V.css("position")&&V.css({position:"relative"}),i.css({position:"absolute",bottom:n,top:"auto"}).trigger("sticky_kit:bottom")):void 0},F=function(){return P(),j()},v=function(){if(k=!0,e.off("touchmove",j),e.off("scroll",j),e.off("resize",F),t(document.body).off("sticky_kit:recalc",F),i.off("sticky_kit:detach",v),i.removeData("sticky_kit"),i.css({position:"",bottom:"",top:"",width:""}),V.position("position",""),_)return null==u&&("left"!==m&&"right"!==m||i.insertAfter(H),H.remove()),i.removeClass(g)},e.on("touchmove",j),e.on("scroll",j),e.on("resize",F),t(document.body).on("sticky_kit:recalc",F),i.on("sticky_kit:detach",v),setTimeout(j,0)}},a=0,l=this.length;a<l;a++)n=this[a],s(t(n));return this}}).call(this);var _createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}();!function(t){var e=function(){function e(){_classCallCheck(this,e),this.top=20,this.setupValue(),this.initSticky()}return _createClass(e,[{key:"setupValue",value:function(){if(t("#main").outerHeight()<t("#secondary").outerHeight)return!1;this.top=20;var e=t("#wpadminbar"),i=t(".osf-sticky-active");e.length>0&&(this.top+=e.height()),i.length>0&&(this.top+=i.outerHeight())}},{key:"initSticky",value:function(){var e=this,i=t(window).width();i<992?jQuery("#secondary > .inner, .woocommerce-single-style-3 .entry-summary .inner").trigger("sticky_kit:detach"):this._makeStickyKit(),t(window).resize(function(){i=t(window).width(),i<992?jQuery("#secondary > .inner, .woocommerce-single-style-3 .entry-summary .inner").trigger("sticky_kit:detach"):e._makeStickyKit()})}},{key:"_makeStickyKit",value:function(){if(t("#main").outerHeight()<t("#secondary .inner").outerHeight())return!1;t("#secondary > .inner").stick_in_parent({parent:"#content > .wrap",offset_top:20}),t(".woocommerce-single-style-3 .entry-summary .inner").stick_in_parent({parent:".woocommerce-single-style-3 .site-main > .product",offset_top:20})}}]),e}();t(document).ready(function(){new e})}(jQuery);
//# sourceMappingURL=sticky-layout.js.map
Back to Directory
File Manager