Files
postshop-backend/public/web/shella/scripts/module.product-footbar.min.js
2026-02-03 15:31:29 +05:00

1 line
1.1 KiB
JavaScript

theme.ProductFootbar=function(){function t(){}t.prototype=$.extend({},t.prototype,{duration:function(){return 1e3*theme.animations.footbar_product.duration},init:function(t){var o=this,e=t.find(".js-footbar-product"),i=$("[data-js-footbar-product-limit]");e.length&&i.length&&($window.on("theme.resize.productFootbar scroll.productFootbar",function(){o._update(e,i)}),this._update(e,i))},_update:function(t,o){var e=o[0].getBoundingClientRect(),i=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0;e.top<i&&!t.hasClass("show")?(t.addClass("show animate"),t.velocity("stop",!0),t.velocity("slideDown",{duration:this.duration(),begin:function(){setTimeout(function(){t.addClass("visible")},0)},complete:function(){t.removeAttr("style")}})):e.top>=i&&t.hasClass("visible")&&(t.velocity("stop",!0),t.velocity("slideUp",{duration:this.duration(),begin:function(){t.removeClass("visible")},complete:function(){t.removeClass("show animate").removeAttr("style")}}))},destroy:function(){$window.unbind("theme.resize.productFootbar scroll.productFootbar")}}),theme.ProductFootbar=new t},$(function(){theme.ProductFootbar()});