File "hotSpot.min.js"

Full Path: /home/ycoalition/public_html/blog/wp-content/themes/woodmart/js/scripts/elements/hotSpot.min.js
File size: 1.59 KB
MIME-type: text/plain
Charset: utf-8

!function(d){d.each(["frontend/element_ready/wd_image_hotspot.default"],function(o,t){woodmartThemeModule.wdElementorAddAction(t,function(){woodmartThemeModule.imageHotspot()})}),woodmartThemeModule.$document.on("wdShopPageInit",function(){woodmartThemeModule.imageHotspot()}),woodmartThemeModule.imageHotspot=function(){d(".wd-image-hotspot").each(function(){var t=d(this),o=t.find(".hotspot-btn");!t.parents(".wd-image-hotspot-wrapper").hasClass("hotspot-action-click")&&1024<woodmartThemeModule.$window.width()||(o.on("click",function(){return t.hasClass("hotspot-opened")?t.removeClass("hotspot-opened"):(t.addClass("hotspot-opened"),t.siblings().removeClass("hotspot-opened")),d(".wd-image-hotspot .hotspot-content").each(function(){var o=d(this),t=(o.removeClass("hotspot-overflow-right hotspot-overflow-left"),o.attr("style",""),o.offset().left),e=woodmartThemeModule.$window.width()-(t+o.outerWidth());768<woodmartThemeModule.windowWidth&&(t<=0&&o.addClass("hotspot-overflow-right"),e<=0&&o.addClass("hotspot-overflow-left")),woodmartThemeModule.windowWidth<=768&&(t<=0&&o.css("marginLeft",Math.abs(t-15)+"px"),e<=0&&o.css("marginLeft",e-15+"px"))}),woodmartThemeModule.$document.trigger("wood-images-loaded"),!1}),woodmartThemeModule.$document.on("click",function(o){o=o.target;if(t.hasClass("hotspot-opened")&&!d(o).is(".wd-image-hotspot")&&!d(o).parents().is(".wd-image-hotspot"))return t.removeClass("hotspot-opened"),!1}))}),d(".wd-image-hotspot-wrapper").each(function(){var o=d(this);o.imagesLoaded(function(){o.addClass("loaded")})})},d(document).ready(function(){woodmartThemeModule.imageHotspot()})}(jQuery);