Files
backend-mm/public/web/shella/scripts/section.lookbook.min.js
2025-09-25 03:03:31 +05:00

1 line
1.4 KiB
JavaScript

theme.LookBook=function(){function o(o){this.$container=$(o),this.namespace=".lookbook",this.onLoad()}return o.prototype=$.extend({},Section.prototype,o.prototype,{onLoad:function(){var o=this.$container.find(".lookbook__item");theme.Global.responsiveHandler({namespace:".lookbook",element:o,delegate:"[data-lookbook-picker-button]",on_desktop:!0,events:{click:function(){var o=$(this),e=o.parents("[data-lookbook-picker]").find("[data-lookbook-product]");o[o.hasClass("open")?"removeClass":"addClass"]("open"),e[o.hasClass("open")?"removeClass":"addClass"]("d-none")}}}),theme.Global.responsiveHandler({namespace:".lookbook",element:o,delegate:"[data-lookbook-picker]",on_desktop:!0,events:{"mouseenter mouseleave":function(o){var e=$(this),t=e.find("[data-lookbook-product-button]"),n=e.find("[data-lookbook-product]");t.hasClass("open")||n["mouseenter"===o.type?"removeClass":"addClass"]("d-none")}}}),theme.Global.responsiveHandler({namespace:".lookbook",element:o,delegate:"[data-lookbook-product-close]",on_desktop:!0,events:{click:function(){$(this).parents("[data-lookbook-picker]").find("[data-lookbook-picker-button]").addClass("open").trigger("click")}}}),o.length&&theme.is_loaded&&theme.ImagesLazyLoad.update()},onUnload:function(){this.$container.off(this.namespace),this.$container.trigger("section.unload"),this.$container.find(".lookbook__item").unbind()}}),o}(),$(function(){theme.sections.register("lookbook",theme.LookBook)});