/*! nanoscrollerjs - v0.8.7 - (c) 2015 james florentino; licensed mit */ !function(a){return"function"==typeof define&&define.amd?define(["jquery"],function(b){return a(b,window,document)}):"object"==typeof exports?module.exports=a(require("jquery"),window,document):a(jquery,window,document)}(function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h;z={paneclass:"nano-pane",sliderclass:"nano-slider",contentclass:"nano-content",enabledclass:"has-scrollbar",flashedclass:"flashed",activeclass:"active",iosnativescrolling:!1,preventpagescrolling:!1,disableresize:!1,alwaysvisible:!1,flashdelay:1500,sliderminheight:20,slidermaxheight:null,documentcontext:null,windowcontext:null},u="scrollbar",t="scroll",l="mousedown",m="mouseenter",n="mousemove",p="mousewheel",o="mouseup",s="resize",h="drag",i="enter",w="up",r="panedown",f="dommousescroll",g="down",x="wheel",j="keydown",k="keyup",v="touchmove",d="microsoft internet explorer"===b.navigator.appname&&/msie 7./i.test(b.navigator.appversion)&&b.activexobject,e=null,d=b.requestanimationframe,y=b.cancelanimationframe,f=c.createelement("div").style,h=function(){var a,b,c,d,e,f;for(d=["t","webkitt","mozt","mst","ot"],a=e=0,f=d.length;f>e;a=++e)if(c=d[a],b=d[a]+"ransform",b in f)return d[a].substr(0,d[a].length-1);return!1}(),g=function(a){return h===!1?!1:""===h?a:h+a.charat(0).touppercase()+a.substr(1)},e=g("transform"),b=e!==!1,a=function(){var a,b,d;return a=c.createelement("div"),b=a.style,b.position="absolute",b.width="100px",b.height="100px",b.overflow=t,b.top="-9999px",c.body.appendchild(a),d=a.offsetwidth-a.clientwidth,c.body.removechild(a),d},c=function(){var a,c,d;return c=b.navigator.useragent,(a=/(?=.+mac os x)(?=.+firefox)/.test(c))?(d=/firefox\/\d{2}\./.exec(c),d&&(d=d[0].replace(/\d+/g,"")),a&&+d>23):!1},q=function(){function j(d,f){this.el=d,this.options=f,e||(e=a()),this.$el=a(this.el),this.doc=a(this.options.documentcontext||c),this.win=a(this.options.windowcontext||b),this.body=this.doc.find("body"),this.$content=this.$el.children("."+this.options.contentclass),this.$content.attr("tabindex",this.options.tabindex||0),this.content=this.$content[0],this.previousposition=0,this.options.iosnativescrolling&&null!=this.el.style.webkitoverflowscrolling?this.nativescrolling():this.generate(),this.createevents(),this.addevents(),this.reset()}return j.prototype.preventscrolling=function(a,b){if(this.isactive)if(a.type===f)(b===g&&a.originalevent.detail>0||b===w&&a.originalevent.detail<0)&&a.preventdefault();else if(a.type===p){if(!a.originalevent||!a.originalevent.wheeldelta)return;(b===g&&a.originalevent.wheeldelta<0||b===w&&a.originalevent.wheeldelta>0)&&a.preventdefault()}},j.prototype.nativescrolling=function(){this.$content.css({webkitoverflowscrolling:"touch"}),this.iosnativescrolling=!0,this.isactive=!0},j.prototype.updatescrollvalues=function(){var a,b;a=this.content,this.maxscrolltop=a.scrollheight-a.clientheight,this.prevscrolltop=this.contentscrolltop||0,this.contentscrolltop=a.scrolltop,b=this.contentscrolltop>this.previousposition?"down":this.contentscrolltop=a.maxscrolltop&&a.prevscrolltop!==a.maxscrolltop?a.$el.trigger("scrollend"):0===a.contentscrolltop&&0!==a.prevscrolltop&&a.$el.trigger("scrolltop"),!1}}(this),up:function(a){return function(b){return a.isbeingdragged=!1,a.pane.removeclass(a.options.activeclass),a.doc.unbind(n,a.events[h]).unbind(o,a.events[w]),a.body.unbind(m,a.events[i]),!1}}(this),resize:function(a){return function(b){a.reset()}}(this),panedown:function(a){return function(b){return a.slidery=(b.offsety||b.originalevent.layery)-.5*a.sliderheight,a.scroll(),a.events.down(b),!1}}(this),scroll:function(a){return function(b){a.updatescrollvalues(),a.isbeingdragged||(a.iosnativescrolling||(a.slidery=a.slidertop,a.setonscrollstyles()),null!=b&&(a.contentscrolltop>=a.maxscrolltop?(a.options.preventpagescrolling&&a.preventscrolling(b,g),a.prevscrolltop!==a.maxscrolltop&&a.$el.trigger("scrollend")):0===a.contentscrolltop&&(a.options.preventpagescrolling&&a.preventscrolling(b,w),0!==a.prevscrolltop&&a.$el.trigger("scrolltop"))))}}(this),wheel:function(a){return function(b){var c;if(null!=b)return c=b.delta||b.wheeldelta||b.originalevent&&b.originalevent.wheeldelta||-b.detail||b.originalevent&&-b.originalevent.detail,c&&(a.slidery+=-c/3),a.scroll(),!1}}(this),enter:function(a){return function(b){var c;if(a.isbeingdragged)return 1!==(b.buttons||b.which)?(c=a.events)[w].apply(c,arguments):void 0}}(this)}},j.prototype.addevents=function(){var a;this.removeevents(),a=this.events,this.options.disableresize||this.win.bind(s,a[s]),this.iosnativescrolling||(this.slider.bind(l,a[g]),this.pane.bind(l,a[r]).bind(""+p+" "+f,a[x])),this.$content.bind(""+t+" "+p+" "+f+" "+v,a[t])},j.prototype.removeevents=function(){var a;a=this.events,this.win.unbind(s,a[s]),this.iosnativescrolling||(this.slider.unbind(),this.pane.unbind()),this.$content.unbind(""+t+" "+p+" "+f+" "+v,a[t])},j.prototype.generate=function(){var a,c,d,f,g,h,i;return f=this.options,h=f.paneclass,i=f.sliderclass,a=f.contentclass,(g=this.$el.children("."+h)).length||g.children("."+i).length||this.$el.append('
'),this.pane=this.$el.children("."+h),this.slider=this.pane.find("."+i),0===e&&c()?(d=b.getcomputedstyle(this.content,null).getpropertyvalue("padding-right").replace(/[^0-9.]+/g,""),c={right:-14,paddingright:+d+14}):e&&(c={right:-e},this.$el.addclass(f.enabledclass)),null!=c&&this.$content.css(c),this},j.prototype.restore=function(){this.stopped=!1,this.iosnativescrolling||this.pane.show(),this.addevents()},j.prototype.reset=function(){var a,b,c,f,g,h,i,j,k,l,m,n;return this.iosnativescrolling?void(this.contentheight=this.content.scrollheight):(this.$el.find("."+this.options.paneclass).length||this.generate().stop(),this.stopped&&this.restore(),a=this.content,f=a.style,g=f.overflowy,d&&this.$content.css({height:this.$content.height()}),b=a.scrollheight+e,l=parseint(this.$el.css("max-height"),10),l>0&&(this.$el.height(""),this.$el.height(a.scrollheight>l?l:a.scrollheight)),i=this.pane.outerheight(!1),k=parseint(this.pane.css("top"),10),h=parseint(this.pane.css("bottom"),10),j=i+k+h,n=math.round(j/b*i),nthis.options.slidermaxheight&&(n=this.options.slidermaxheight),g===t&&f.overflowx!==t&&(n+=e),this.maxslidertop=j-n,this.contentheight=b,this.paneheight=i,this.paneouterheight=j,this.sliderheight=n,this.panetop=k,this.slider.height(n),this.events.scroll(),this.pane.show(),this.isactive=!0,a.scrollheight===a.clientheight||this.pane.outerheight(!0)>=a.scrollheight&&g!==t?(this.pane.hide(),this.isactive=!1):this.el.clientheight===a.scrollheight&&g===t?this.slider.hide():this.slider.show(),this.pane.css({opacity:this.options.alwaysvisible?1:"",visibility:this.options.alwaysvisible?"visible":""}),c=this.$content.css("position"),("static"===c||"relative"===c)&&(m=parseint(this.$content.css("right"),10),m&&this.$content.css({right:"",marginright:m})),this)},j.prototype.scroll=function(){return this.isactive?(this.slidery=math.max(0,this.slidery),this.slidery=math.min(this.maxslidertop,this.slidery),this.$content.scrolltop(this.maxscrolltop*this.slidery/this.maxslidertop),this.iosnativescrolling||(this.updatescrollvalues(),this.setonscrollstyles()),this):void 0},j.prototype.scrollbottom=function(a){return this.isactive?(this.$content.scrolltop(this.contentheight-this.$content.height()-a).trigger(p),this.stop().restore(),this):void 0},j.prototype.scrolltop=function(a){return this.isactive?(this.$content.scrolltop(+a).trigger(p),this.stop().restore(),this):void 0},j.prototype.scrollto=function(a){return this.isactive?(this.scrolltop(this.$el.find(a).get(0).offsettop),this):void 0},j.prototype.stop=function(){return y&&this.scrollraf&&(y(this.scrollraf),this.scrollraf=null),this.stopped=!0,this.removeevents(),this.iosnativescrolling||this.pane.hide(),this},j.prototype.destroy=function(){return this.stopped||this.stop(),!this.iosnativescrolling&&this.pane.length&&this.pane.remove(),d&&this.$content.height(""),this.$content.removeattr("tabindex"),this.$el.hasclass(this.options.enabledclass)&&(this.$el.removeclass(this.options.enabledclass),this.$content.css({right:""})),this},j.prototype.flash=function(){return!this.iosnativescrolling&&this.isactive?(this.reset(),this.pane.addclass(this.options.flashedclass),settimeout(function(a){return function(){a.pane.removeclass(a.options.flashedclass)}}(this),this.options.flashdelay),this):void 0},j}(),a.fn.nanoscroller=function(b){return this.each(function(){var c,d;if((d=this.nanoscroller)||(c=a.extend({},z,b),this.nanoscroller=d=new q(this,c)),b&&"object"==typeof b){if(a.extend(d.options,b),null!=b.scrollbottom)return d.scrollbottom(b.scrollbottom);if(null!=b.scrolltop)return d.scrolltop(b.scrolltop);if(b.scrollto)return d.scrollto(b.scrollto);if("bottom"===b.scroll)return d.scrollbottom(0);if("top"===b.scroll)return d.scrolltop(0);if(b.scroll&&b.scroll instanceof a)return d.scrollto(b.scroll);if(b.stop)return d.stop();if(b.destroy)return d.destroy();if(b.flash)return d.flash()}return d.reset()})},a.fn.nanoscroller.constructor=q}); //# sourcemappingurl=jquery.nanoscroller.min.js.map