lg-5.js 2.0 KB

12
  1. (globalThis.webpackChunksakurairo_scripts=globalThis.webpackChunksakurairo_scripts||[]).push([[3637],{2941:function(e){var t,r,a,i;e.exports=(t=function(){return(t=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},r="lgUpdateSlides",a="lgBeforeSlide",i={pager:!0},function(){function e(e,r){return this.core=e,this.$LG=r,this.settings=t(t({},i),this.core.settings),this}return e.prototype.getPagerHtml=function(e){for(var t="",r=0;r<e.length;r++)t+='<span data-lg-item-id="'+r+'" class="lg-pager-cont"> \n <span data-lg-item-id="'+r+'" class="lg-pager"></span>\n <div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+e[r].thumb+'" /></div>\n </span>';return t},e.prototype.init=function(){var e=this;if(this.settings.pager){var t;this.core.$lgComponents.prepend('<div class="lg-pager-outer"></div>');var i=this.core.outer.find(".lg-pager-outer");i.html(this.getPagerHtml(this.core.galleryItems)),i.first().on("click.lg touchend.lg",(function(t){var r=e.$LG(t.target);if(r.hasAttribute("data-lg-item-id")){var a=parseInt(r.attr("data-lg-item-id"));e.core.slide(a,!1,!0,!1)}})),i.first().on("mouseover.lg",(function(){clearTimeout(t),i.addClass("lg-pager-hover")})),i.first().on("mouseout.lg",(function(){t=setTimeout((function(){i.removeClass("lg-pager-hover")}))})),this.core.LGel.on(a+".pager",(function(t){var r=t.detail.index;e.manageActiveClass.call(e,r)})),this.core.LGel.on(r+".pager",(function(){i.empty(),i.html(e.getPagerHtml(e.core.galleryItems)),e.manageActiveClass(e.core.index)}))}},e.prototype.manageActiveClass=function(e){var t=this.core.outer.find(".lg-pager-cont");t.removeClass("lg-pager-active"),t.eq(e).addClass("lg-pager-active")},e.prototype.destroy=function(){this.core.outer.find(".lg-pager-outer").remove(),this.core.LGel.off(".lg.pager"),this.core.LGel.off(".pager")},e}())}}]);
  2. //# sourceMappingURL=lg-5.js.map