arrow.min.js 2.22 KB
N2Require("SmartSliderWidgetArrowGrow",[],[],function(t,e,i){function s(e,i,s){this.size=48,this.sidePadding=25,this.delay=s,this.slider=window[e],this.slider.started(t.proxy(this.start,this,e,i,s))}return s.prototype.start=function(e,i,s){if(this.slider.sliderElement.data("arrow"))return!1;if(this.previous=t("#"+e+"-arrow-previous").on("click",t.proxy(function(t){t.stopPropagation(),this.slider[nextend.rtl.previous]()},this)),this.previousTitle=this.previous.find(".nextend-arrow-title"),this.previous.on({mouseenter:t.proxy(this.mouseEnter,this,this.previous,this.previousTitle),mouseleave:t.proxy(this.mouseLeave,this,this.previous,this.previousTitle)}),this.next=t("#"+e+"-arrow-next").on("click",t.proxy(function(t){t.stopPropagation(),this.slider[nextend.rtl.next]()},this)),this.nextTitle=this.next.find(".nextend-arrow-title"),this.next.on({mouseenter:t.proxy(this.mouseEnter,this,this.next,this.nextTitle),mouseleave:t.proxy(this.mouseLeave,this,this.next,this.nextTitle)}),this.slider.isShuffled){for(var r=[],n=0;n<this.slider.realSlides.length;n++){var h=this.slider.realSlides[n];r.push(i[h.originalIndex])}i=r}this.titles=i,this.slider.sliderElement.data("arrow",this).on({sliderSwitchTo:t.proxy(function(t,e){this.onRefresh(e)},this),BeforeVisible:t.proxy(function(){this.onRefresh(this.slider.currentSlide.index)},this)})},s.prototype.onRefresh=function(t){var e=t-1;0>e&&(e=this.slider.slides.length-1);var i=this.slider.slides[e].slides[0].index;this[nextend.rtl.previous+"Title"].html(this.titles[i]),this[nextend.rtl.previous].width()!=this.size&&this[nextend.rtl.previous].width(this.size+this.sidePadding+this[nextend.rtl.previous+"Title"].width());var s=t+1;s>=this.slider.slides.length&&(s=0);var r=this.slider.slides[s].slides[0].index;this[nextend.rtl.next+"Title"].html(this.titles[r]),this[nextend.rtl.next].width()!=this.size&&this[nextend.rtl.next].width(this.size+this.sidePadding+this[nextend.rtl.next+"Title"].width())},s.prototype.mouseEnter=function(t,e,i){var s=t.data("ssTween");s&&s.pause(),t.data("ssTween",NextendTween.to(t,.4,{width:this.size+this.sidePadding+e.width(),delay:this.delay}))},s.prototype.mouseLeave=function(t,e,i){var s=t.data("ssTween");s&&s.pause(),t.data("ssTween",NextendTween.to(t,.4,{width:this.size}))},s});