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

1 line
1.3 KiB
JavaScript

theme.ProductPage=function(){function t(t){this.$container=$(t),this.namespace=".product-page",this.onLoad()}return t.prototype=$.extend({},t.prototype,{onLoad:function(){var t=this.$container.find("[data-js-product]"),e=t.find("[data-js-product-gallery]"),i=t.find("[data-js-product-countdown] .js-countdown"),o=t.find(".js-text-countdown"),n=t.find(".js-visitors");if(e.length)if(this.$gallery=e,"mobile"===this.$gallery.find("[data-js-product-gallery-main]").attr("data-js-product-gallery-main")){function r(){theme.current.is_mobile&&theme.ProductGallery.init(e)}$window.on("theme.resize",r),r()}else theme.ProductGallery.init(e);theme.is_loaded&&(theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init(),i.length&&theme.ProductCountdown.init(i),o.length&&theme.ProductTextCountdown.init(o),n.length&&theme.ProductVisitors.init(n),theme.StoreLists.checkProductStatus(t),theme.Tabs&&theme.Tabs.init()),theme.StickySidebar&&theme.StickySidebar.init(this.$container)},onUnload:function(){this.$container.off(this.namespace),this.$gallery&&this.$gallery.length&&(theme.ProductGallery.destroy(this.$gallery),this.$gallery=null),theme.StickySidebar&&theme.StickySidebar.destroy(this.$container),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("product-page",theme.ProductPage)});