vendor: 9,935 bytes, lines 1-171
1/* nicescroll v3.7.0 InuYaksa - MIT - http://nicescroll.areaaperta.com */ 2!function (e) { 3 "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e(require("jquery")) : e(jQuery) 4}(function (e) { 5 "use strict"; 6 var o = !1, t = !1, r = 0, i = 2e3, n = 0, s = e, l = function () { 7 return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || !1 8 }(), a = function () { 9 return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || !1 10 }(); 11 l ? window.cancelAnimationFrame || (a = function (e) { 12 }) : (l = function (e, o) { 13 var t = (new Date).getTime(), r = Math.max(0, 16 - (t - lastTime)), i = window.setTimeout(function () { 14 e(t + r) 15 }, r); 16 return lastTime = t + r, i 17 }, a = function (e) { 18 window.clearTimeout(e) 19 }); 20 var c = window.MutationObserver || window.WebKitMutationObserver || !1, d = { 21 zindex: "auto", 22 cursoropacitymin: 0, 23 cursoropacitymax: 1, 24 cursorcolor: "#424242", 25 cursorwidth: "6px", 26 cursorborder: "1px solid #fff", 27 cursorborderradius: "5px", 28 scrollspeed: 60, 29 mousescrollstep: 24, 30 touchbehavior: !1, 31 emulatetouch: !1, 32 hwacceleration: !0, 33 usetransition: !0, 34 boxzoom: !1, 35 dblclickzoom: !0, 36 gesturezoom: !0, 37 grabcursorenabled: !0, 38 autohidemode: !0, 39 background: "", 40 iframeautoresize: !0, 41 cursorminheight: 32, 42 preservenativescrolling: !0, 43 railoffset: !1, 44 railhoffset: !1, 45 bouncescroll: !0, 46 spacebarenabled: !0, 47 railpadding: {top: 0, right: 0, left: 0, bottom: 0}, 48 disableoutline: !0, 49 horizrailenabled: !0, 50 railalign: "right", 51 railvalign: "bottom", 52 enabletranslate3d: !0, 53 enablemousewheel: !0, 54 enablekeyboard: !0, 55 smoothscroll: !0, 56 sensitiverail: !0, 57 enablemouselockapi: !0, 58 cursorfixedheight: !1, 59 directionlockdeadzone: 6, 60 hidecursordelay: 400, 61 nativeparentscrolling: !0, 62 enablescrollonselection: !0, 63 overflowx: !0, 64 overflowy: !0, 65 cursordragspeed: .3, 66 rtlmode: "auto", 67 cursordragontouch: !1, 68 oneaxismousemode: "auto", 69 scriptpath: function () { 70 var e = document.getElementsByTagName("script"), o = e.length ? e[e.length - 1].src.split("?")[0] : ""; 71 return o.split("/").length > 0 ? o.split("/").slice(0, -1).join("/") + "/" : "" 72 }(), 73 preventmultitouchscrolling: !0, 74 disablemutationobserver: !1, 75 enableobserver: !0 76 }, u = !1, h = function () { 77 if (u) return u; 78 var e = document.createElement("DIV"), o = e.style, t = navigator.userAgent, r = navigator.platform, i = {}; 79 return i.haspointerlock = "pointerLockElement" in document || "webkitPointerLockElement" in document || "mozPointerLockElement" in document, i.isopera = "opera" in window, i.isopera12 = i.isopera && "getUserMedia" in navigator, i.isoperamini = "[object OperaMini]" === Object.prototype.toString.call(window.operamini), i.isie = "all" in document && "attachEvent" in e && !i.isopera, i.isieold = i.isie && !("msInterpolationMode" in o), i.isie7 = i.isie && !i.isieold && (!("documentMode" in document) || 7 === document.documentMode), i.isie8 = i.isie && "documentMode" in document && 8 === document.documentMode, i.isie9 = i.isie && "performance" in window && 9 === document.documentMode, i.isie10 = i.isie && "performance" in window && 10 === document.documentMode, i.isie11 = "msRequestFullscreen" in e && document.documentMode >= 11, i.ismsedge = "msCredentials" in window, i.isie9mobile = /iemobile.9/i.test(t), i.isie9mobile && (i.isie9 = !1), i.isie7mobile = !i.isie9mobile && i.isie7 && /iemobile/i.test(t), i.ismozilla = "MozAppearance" in o, i.iswebkit = !i.ismsedge && "WebkitAppearance" in o, i.ischrome = !i.ismsedge && "chrome" in window, i.ischrome38 = i.ischrome && "touchAction" in o, i.ischrome22 = !i.ischrome38 && i.ischrome && i.haspointerlock, i.ischrome26 = !i.ischrome38 && i.ischrome && "transition" in o, i.cantouch = "ontouchstart" in document.documentElement || "ontouchstart" in window, i.hasw3ctouch = (window.PointerEvent || !1) && (navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0), i.hasmstouch = !i.hasw3ctouch && (window.MSPointerEvent || !1), i.ismac = /^mac$/i.test(r), i.isios = i.cantouch && /iphone|ipad|ipod/i.test(r), i.isios4 = i.isios && !("seal" in Object), i.isios7 = i.isios && "webkitHidden" in document, i.isios8 = i.isios && "hidden" in document, i.isios10 = i.isios && window.Proxy, i.isandroid = /android/i.test(t), i.haseventlistener = "addEventListener" in e, i.trstyle = !1, i.hastransform = !1, i.hastranslate3d = !1, i.transitionstyle = !1, i.hastransition = !1, i.transitionend = !1, i.trstyle = "transform", i.hastransform = "transform" in o || function () { 80 var e, t = ["msTransform", "webkitTransform", "MozTransform", "OTransform"]; 81 for (e = 0; e < t.length; e++) if (void 0 !== o[t[e]]) { 82 i.trstyle = t[e]; 83 break 84 } 85 i.hastransform = !!i.trstyle 86 }(), i.hastransform && (o[i.trstyle] = "translate3d(1px,2px,3px)", i.hastranslate3d = /translate3d/.test(o[i.trstyle])), i.transitionstyle = "transition", i.prefixstyle = "", i.transitionend = "transitionend", i.hastransition = "transition" in o || function () { 87 i.transitionend = !1; 88 for (var e = ["webkitTransition", "msTransition", "MozTransition", "OTransition", "OTransition", "KhtmlTransition"], t = ["-webkit-", "-ms-", "-moz-", "-o-", "-o", "-khtml-"], r = ["webkitTransitionEnd", "msTransitionEnd", "transitionend", "otransitionend", "oTransitionEnd", "KhtmlTransitionEnd"], n = 0; n < e.length; n++) if (e[n] in o) { 89 i.transitionstyle = e[n], i.prefixstyle = t[n], i.transitionend = r[n]; 90 break 91 } 92 i.ischrome26 && (i.prefixstyle = t[1]), i.hastransition = i.transitionstyle 93 }(), i.cursorgrabvalue = function () { 94 var e = ["grab", "-webkit-grab", "-moz-grab"]; 95 (i.ischrome && !i.ischrome38 || i.isie) && (e = []); 96 for (var t = 0; t < e.length; t++) { 97 var r = e[t]; 98 if (o.cursor = r, o.cursor == r) return r 99 } 100 return "url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize" 101 }(), i.hasmousecapture = "setCapture" in e, i.hasMutationObserver = !1 !== c, e = null, u = i, i 102 }, p = function (e, u) { 103 function p() { 104 var e = b.doc.css(z.trstyle); 105 return !(!e || "matrix" != e.substr(0, 6)) && e.replace(/^.*\((.*)\)$/g, "$1").replace(/px/g, "").split(/, +/) 106 } 107 108 function f() { 109 var e = b.win; 110 if ("zIndex" in e) return e.zIndex(); 111 for (; e.length > 0;) { 112 if (9 == e[0].nodeType) return !1; 113 var o = e.css("zIndex"); 114 if (!isNaN(o) && 0 != o) return parseInt(o); 115 e = e.parent() 116 } 117 return !1 118 } 119 120 function g(e, o, t) { 121 var r = e.css(o), i = parseFloat(r); 122 if (isNaN(i)) { 123 var n = 3 == (i = E[r] || 0) ? t ? b.win.outerHeight() - b.win.innerHeight() : b.win.outerWidth() - b.win.innerWidth() : 1; 124 return b.isie8 && i && (i += 1), n ? i : 0 125 } 126 return i 127 } 128 129 function w(e, o, t, r) { 130 b._bind(e, o, function (r) { 131 var i = { 132 original: r = r || window.event, 133 target: r.target || r.srcElement, 134 type: "wheel", 135 deltaMode: "MozMousePixelScroll" == r.type ? 0 : 1, 136 deltaX: 0, 137 deltaZ: 0, 138 preventDefault: function () { 139 return r.preventDefault ? r.preventDefault() : r.returnValue = !1, !1 140 }, 141 stopImmediatePropagation: function () { 142 r.stopImmediatePropagation ? r.stopImmediatePropagation() : r.cancelBubble = !0 143 } 144 }; 145 return "mousewheel" == o ? (r.wheelDeltaX && (i.deltaX = -.025 * r.wheelDeltaX), r.wheelDeltaY && (i.deltaY = -.025 * r.wheelDeltaY), !i.deltaY && !i.deltaX && (i.deltaY = -.025 * r.wheelDelta)) : i.deltaY = r.detail, t.call(e, i) 146 }, r) 147 } 148 149 function v(e, o, t) { 150 var r, i; 151 if (0 == e.deltaMode ? (r = -Math.floor(e.deltaX * (b.opt.mousescrollstep / 54)), i = -Math.floor(e.deltaY * (b.opt.mousescrollstep / 54))) : 1 == e.deltaMode && (r = -Math.floor(e.deltaX * b.opt.mousescrollstep), i = -Math.floor(e.deltaY * b.opt.mousescrollstep)), o && b.opt.oneaxismousemode && 0 == r && i && (r = i, i = 0, t && (r < 0 ? b.getScrollLeft() >= b.page.maxw : b.getScrollLeft() <= 0) && (i = r, r = 0)), b.isrtlmode && (r = -r), r && (b.scrollmom && b.scrollmom.stop(), b.lastdeltax += r, b.debounced("mousewheelx", function () { 152 var e = b.lastdeltax; 153 b.lastdeltax = 0, b.rail.drag || b.doScrollLeftBy(e) 154 }, 15)), i) { 155 if (b.opt.nativeparentscrolling && t && !b.ispage && !b.zoomactive) if (i < 0) { 156 if (b.getScrollTop() >= b.page.maxh) return !0 157 } else if (b.getScrollTop() <= 0) return !0; 158 b.scrollmom && b.scrollmom.stop(), b.lastdeltay += i, b.synched("mousewheely", function () { 159 var e = b.lastdeltay; 160 b.lastdeltay = 0, b.rail.drag || b.doScrollBy(e) 161 }, 15) 162 } 163 return e.stopImmediatePropagation() 164 } 165 166 var b = this; 167 if (this.version = "3.7.0", this.name = "nicescroll", this.me = u, this.opt = { 168 doc: s("body"), 169 win: !1 170 }, s.extend(this.opt, d), this.opt.snapbackspeed = 80, e) for (var y in b.opt) void 0 !== e[y] && (b.opt[y] = e[y]); 171 if (b.opt.disablemutationobserver && (c = !1), this.doc = b.opt.doc, this.iddoc = this.doc && this.doc[0] ? this.doc[0].id || "" : "", this.ispage = /^BODY|HTML/.test(b.opt.win ? b.opt.win[0].nodeName : this.doc[0].nodeName), this.haswrapper = !1 !== b.opt.win, this.win = b.opt.win || (this.ispage ? s(window) : this.doc), this.docscroll = this.ispage && !this.haswrapper ? s(window) : this.win, this.body = s("body"), this.viewport = !1, this.isfi
171xed = !1, this.iframe = !1, this.isiframe = "IFRAME" == this.doc[0].nodeName && "IFRAME" == this.win[0].nodeName, this.istextarea = "TEXTAREA" == this.win[0].nodeName, this.forcescreen = !1, this.canshowonmouseevent = "scroll" != b.opt.autohidemode, this.onmousedown = !1, this.onmouseup = !1, this.onmousemove = !1, this.onmousewheel = !1, this.onkeypress = !1, this.ongesturezoom = !1, this.onclick = !1, this.onscrollstart = !1, this.onscrollend = !1, this.onscrollcancel = !1, this.onzoomin = !1, this.onzoomout = !1, this.view = !1, this.page = !1, this.scroll = { 172 x: 0, 173 y: 0 174 }, this.scrollratio = {x: 0, y: 0}, this.cursorheight = 20, this.scrollvaluemax = 0, "auto" == this.opt.rtlmode) { 175 var x = this.win[0] == window ? this.body : this.win, 176 S = x.css("writing-mode") || x.css("-webkit-writing-mode") || x.css("-ms-writing-mode") || x.css("-moz-writing-mode"); 177 "horizontal-tb" == S || "lr-tb" == S || "" == S ? (this.isrtlmode = "rtl" == x.css("direction"), this.isvertical = !1) : (this.isrtlmode = "vertical-rl" == S || "tb" == S || "tb-rl" == S || "rl-tb" == S, this.isvertical = "vertical-rl" == S || "tb" == S || "tb-rl" == S) 178 } else this.isrtlmode = !0 === this.opt.rtlmode, this.isvertical = !1; 179 this.scrollrunning = !1, this.scrollmom = !1, this.observer = !1, this.observerremover = !1, this.observerbody = !1; 180 do { 181 this.id = "ascrail" + i++ 182 } while (document.getElementById(this.id)); 183 this.rail = !1, this.cursor = !1, this.cursorfreezed = !1, this.selectiondrag = !1, this.zoom = !1, this.zoomactive = !1, this.hasfocus = !1, this.hasmousefocus = !1, this.visibility = !0, this.railslocked = !1, this.locked = !1, this.hidden = !1, this.cursoractive = !0, this.wheelprevented = !1, this.overflowx = b.opt.overflowx, this.overflowy = b.opt.overflowy, this.nativescrollingarea = !1, this.checkarea = 0, this.events = [], this.saved = {}, this.delaylist = {}, this.synclist = {}, this.lastdeltax = 0, this.lastdeltay = 0, this.detected = h(); 184 var z = s.extend({}, this.detected); 185 this.canhwscroll = z.hastransform && b.opt.hwacceleration, this.ishwscroll = this.canhwscroll && b.haswrapper, this.isrtlmode ? this.isvertical ? this.hasreversehr = !(z.iswebkit || z.isie || z.isie11) : this.hasreversehr = !(z.iswebkit || z.isie && !z.isie10 && !z.isie11) : this.hasreversehr = !1, this.istouchcapable = !1, z.cantouch || !z.hasw3ctouch && !z.hasmstouch ? !z.cantouch || z.isios || z.isandroid || !z.iswebkit && !z.ismozilla || (this.istouchcapable = !0) : this.istouchcapable = !0, b.opt.enablemouselockapi || (z.hasmousecapture = !1, z.haspointerlock = !1), this.debounced = function (e, o, t) { 186 b && (b.delaylist[e] || !1 || (b.delaylist[e] = { 187 h: l(function () { 188 b.delaylist[e].fn.call(b), b.delaylist[e] = !1 189 }, t) 190 }, o.call(b)), b.delaylist[e].fn = o) 191 }; 192 var T = !1; 193 this.synched = function (e, o) { 194 return b.synclist[e] = o, function () { 195 T || (l(function () { 196 if (b) { 197 T = !1; 198 for (var e in b.synclist) { 199 var o = b.synclist[e]; 200 o && o.call(b), b.synclist[e] = !1 201 } 202 } 203 }), T = !0) 204 }(), e 205 }, this.unsynched = function (e) { 206 b.synclist[e] && (b.synclist[e] = !1) 207 }, this.css = function (e, o) { 208 for (var t in o) b.saved.css.push([e, t, e.css(t)]), e.css(t, o[t]) 209 }, this.scrollTop = function (e) { 210 return void 0 === e ? b.getScrollTop() : b.setScrollTop(e) 211 }, this.scrollLeft = function (e) { 212 return void 0 === e ? b.getScrollLeft() : b.setScrollLeft(e) 213 }; 214 var k = function (e, o, t, r, i, n, s) { 215 this.st = e, this.ed = o, this.spd = t, this.p1 = r || 0, this.p2 = i || 1, this.p3 = n || 0, this.p4 = s || 1, this.ts = (new Date).getTime(), this.df = this.ed - this.st 216 }; 217 if (k.prototype = { 218 B2: function (e) { 219 return 3 * e * e * (1 - e) 220 }, B3: function (e) { 221 return 3 * e * (1 - e) * (1 - e) 222 }, B4: function (e) { 223 return (1 - e) * (1 - e) * (1 - e) 224 }, getNow: function () { 225 var e = 1 - ((new Date).getTime() - this.ts) / this.spd, o = this.B2(e) + this.B3(e) + this.B4(e); 226 return e < 0 ? this.ed : this.st + Math.round(this.df * o) 227 }, update: function (e, o) { 228 return this.st = this.getNow(), this.ed = e, this.spd = o, this.ts = (ne
vendor: 5,694 bytes, lines 228-325
228w Date).getTime(), this.df = this.ed - this.st, this 229 } 230 }, this.ishwscroll) { 231 this.doc.translate = { 232 x: 0, 233 y: 0, 234 tx: "0px", 235 ty: "0px" 236 }, z.hastranslate3d && z.isios && this.doc.css("-webkit-backface-visibility", "hidden"), this.getScrollTop = function (e) { 237 if (!e) { 238 var o = p(); 239 if (o) return 16 == o.length ? -o[13] : -o[5]; 240 if (b.timerscroll && b.timerscroll.bz) return b.timerscroll.bz.getNow() 241 } 242 return b.doc.translate.y 243 }, this.getScrollLeft = function (e) { 244 if (!e) { 245 var o = p(); 246 if (o) return 16 == o.length ? -o[12] : -o[4]; 247 if (b.timerscroll && b.timerscroll.bh) return b.timerscroll.bh.getNow() 248 } 249 return b.doc.translate.x 250 }, this.notifyScrollEvent = function (e) { 251 var o = document.createEvent("UIEvents"); 252 o.initUIEvent("scroll", !1, !0, window, 1), o.niceevent = !0, e.dispatchEvent(o) 253 }; 254 var M = this.isrtlmode ? 1 : -1; 255 z.hastranslate3d && b.opt.enabletranslate3d ? (this.setScrollTop = function (e, o) { 256 b.doc.translate.y = e, b.doc.translate.ty = -1 * e + "px", b.doc.css(z.trstyle, "translate3d(" + b.doc.translate.tx + "," + b.doc.translate.ty + ",0px)"), o || b.notifyScrollEvent(b.win[0]) 257 }, this.setScrollLeft = function (e, o) { 258 b.doc.translate.x = e, b.doc.translate.tx = e * M + "px", b.doc.css(z.trstyle, "translate3d(" + b.doc.translate.tx + "," + b.doc.translate.ty + ",0px)"), o || b.notifyScrollEvent(b.win[0]) 259 }) : (this.setScrollTop = function (e, o) { 260 b.doc.translate.y = e, b.doc.translate.ty = -1 * e + "px", b.doc.css(z.trstyle, "translate(" + b.doc.translate.tx + "," + b.doc.translate.ty + ")"), o || b.notifyScrollEvent(b.win[0]) 261 }, this.setScrollLeft = function (e, o) { 262 b.doc.translate.x = e, b.doc.translate.tx = e * M + "px", b.doc.css(z.trstyle, "translate(" + b.doc.translate.tx + "," + b.doc.translate.ty + ")"), o || b.notifyScrollEvent(b.win[0]) 263 }) 264 } else this.getScrollTop = function () { 265 return b.docscroll.scrollTop() 266 }, this.setScrollTop = function (e) { 267 return setTimeout(function () { 268 b && b.docscroll.scrollTop(e) 269 }, 1) 270 }, this.getScrollLeft = function () { 271 return b.hasreversehr ? b.detected.ismozilla ? b.page.maxw - Math.abs(b.docscroll.scrollLeft()) : b.page.maxw - b.docscroll.scrollLeft() : b.docscroll.scrollLeft() 272 }, this.setScrollLeft = function (e) { 273 return setTimeout(function () { 274 if (b) return b.hasreversehr && (e = b.detected.ismozilla ? -(b.page.maxw - e) : b.page.maxw - e), b.docscroll.scrollLeft(e) 275 }, 1) 276 }; 277 this.getTarget = function (e) { 278 return !!e && (e.target ? e.target : !!e.srcElement && e.srcElement) 279 }, this.hasParent = function (e, o) { 280 if (!e) return !1; 281 for (var t = e.target || e.srcElement || e || !1; t && t.id != o;) t = t.parentNode || !1; 282 return !1 !== t 283 }; 284 var E = {thin: 1, medium: 3, thick: 5}; 285 if (this.getDocumentScrollOffset = function () { 286 return { 287 top: window.pageYOffset || document.documentElement.scrollTop, 288 left: window.pageXOffset || document.documentElement.scrollLeft 289 } 290 }, this.getOffset = function () { 291 if (b.isfixed) { 292 var e = b.win.offset(), o = b.getDocumentScrollOffset(); 293 return e.top -= o.top, e.left -= o.left, e 294 } 295 var t = b.win.offset(); 296 if (!b.viewport) return t; 297 var r = b.viewport.offset(); 298 return {top: t.top - r.top, left: t.left - r.left} 299 }, this.updateScrollBar = function (e) { 300 var o, t; 301 if (b.ishwscroll) b.rail.css({height: b.win.innerHeight() - (b.opt.railpadding.top + b.opt.railpadding.bottom)}), b.railh && b.railh.css({width: b.win.innerWidth() - (b.opt.railpadding.left + b.opt.railpadding.right)}); else { 302 var r = b.getOffset(); 303 if (o = { 304 top: r.top, 305 left: r.left - (b.opt.railpadding.left + b.opt.railpadding.right) 306 }, o.top += g(b.win, "border-top-width", !0), o.left += b.rail.align ? b.win.outerWidth() - g(b.win, "border-right-width") - b.rail.width : g(b.win, "border-left-width"), (t = b.opt.railoffset) && (t.top && (o.top += t.top), t.left && (o.left += t.left)), b.railslocked || b.rail.css({ 307 top: o.top, 308 left: o.left, 309 height: (e ? e.h : b.win.innerHeight()) - (b.opt.railpadding.top + b.opt.railpadding.bottom) 310 }), b.zoom && b.zoom.css({ 311 top: o.top + 1, 312 left: 1 == b.rail.align ? o.left - 20 : o.left + b.rail.width + 4 313 }), b.railh && !b.railslocked) { 314 o = { 315 top: r.top, 316 left: r.left 317 }, (t = b.opt.railhoffset) && (t.top && (o.top += t.top), t.left && (o.left += t.left)); 318 var i = b.railh.align ? o.top + g(b.win, "border-top-width", !0) + b.win.innerHeight() - b.railh.height : o.top + g(b.win, "border-top-width", !0), 319 n = o.left + g(b.win, "border-left-width"); 320 b.railh.css({top: i - (b.opt.railpadding.top + b.opt.railpadding.bottom), left: n, width: b.railh.width}) 321 } 322 } 323 }, this.doRailClick = function (e, o, t) { 324 var r, i, n, s; 325 b.railslocked || (b.cancelEvent(e), o ? (r = t ? b.doScrollLeft : b.doScrollTop)(n = t ? (e.pageX - b.railh.offset().left - b.cursorwidth / 2) * b.scrollratio.x : (e.pageY - b.rail.offset().top - b.cursorheight / 2) * b.scrollratio.y) : (r = t ? b.doScrollLeftBy : b.doScrollBy, n = t ? b.scroll.x : b.scroll.y, s = t ? e.pageX - b.railh.offset().left : e.pageY - b.rail.offset().top, i = t ? b.view.w : b.view.h, r(n >
325= s ? i : -i))) 326 }, b.hasanimationframe = "requestAnimationFrame" in window, b.hascancelanimationframe = "cancelAnimationFrame" in window, this.init = function () { 327 if (b.saved.css = [], z.isie7mobile) return !0; 328 if (z.isoperamini) return !0; 329 if (z.isandroid && !("hidden" in document)) return !0; 330 var e = z.ismodernie || z.isie10 ? {"-ms-overflow-style": "none"} : {"overflow-y": "hidden"}; 331 if (b.opt.emulatetouch = b.opt.emulatetouch || b.opt.touchbehavior, b.zindex = "auto", b.ispage || "auto" != b.opt.zindex ? b.zindex = b.opt.zindex : b.zindex = f() || "auto", !b.ispage && "auto" != b.zindex && b.zindex > n && (n = b.zindex), b.isie && 0 == b.zindex && "auto" == b.opt.zindex && (b.zindex = "auto"), !b.ispage || !z.cantouch && !z.isieold && !z.isie9mobile) { 332 var i = b.docscroll; 333 b.ispage && (i = b.haswrapper ? b.win : b.doc), z.isie9mobile || b.css(i, e), b.ispage && z.isie7 && ("BODY" == b.doc[0].nodeName ? b.css(s("html"), {"overflow-y": "hidden"}) : "HTML" == b.doc[0].nodeName && b.css(s("body"), e)), !z.isios || b.ispage || b.haswrapper || b.css(s("body"), {"-webkit-overflow-scrolling": "touch"}); 334 var l = s(document.createElement("div")); 335 l.css({ 336 position: "relative", 337 top: 0, 338 float: "right", 339 width: b.opt.cursorwidth, 340 height: 0, 341 "background-color": b.opt.cursorcolor, 342 border: b.opt.cursorborder, 343 "background-clip": "padding-box", 344 "-webkit-border-radius": b.opt.cursorborderradius, 345 "-moz-border-radius": b.opt.cursorborderradius, 346 "border-radius": b.opt.cursorborderradius 347 }), l.hborder = parseFloat(l.outerHeight() - l.innerHeight()), l.addClass("nicescroll-cursors"), b.cursor = l; 348 var a = s(document.createElement("div")); 349 a.attr("id", b.id), a.addClass("nicescroll-rails nicescroll-rails-vr"); 350 var d, u, h = ["left", "right", "top", "bottom"]; 351 for (var p in h) u = h[p], (d = b.opt.railpadding[u]) ? a.css("padding-" + u, d + "px") : b.opt.railpadding[u] = 0; 352 a.append(l), a.width = Math.max(parseFloat(b.opt.cursorwidth), l.outerWidth()), a.css({ 353 width: a.width + "px", 354 zIndex: b.zindex, 355 background: b.opt.background, 356 cursor: "default" 357 }), a.visibility = !0, a.scrollable = !0, a.align = "left" == b.opt.railalign ? 0 : 1, b.rail = a, b.rail.drag = !1; 358 var g = !1; 359 !b.opt.boxzoom || b.ispage || z.isieold || (g = document.createElement("div"), b.bind(g, "click", b.doZoom), b.bind(g, "mouseenter", function () { 360 b.zoom.css("opacity", b.opt.cursoropacitymax) 361 }), b.bind(g, "mouseleave", function () { 362 b.zoom.css("opacity", b.opt.cursoropacitymin) 363 }), b.zoom = s(g), b.zoom.css({ 364 cursor: "pointer", 365 zIndex: b.zindex, 366 backgroundImage: "url(" + b.opt.scriptpath + "zoomico.png)", 367 height: 18, 368 width: 18, 369 backgroundPosition: "0px 0px" 370 }), b.opt.dblclickzoom && b.bind(b.win, "dblclick", b.doZoom), z.cantouch && b.opt.gesturezoom && (b.ongesturezoom = function (e) { 371 return e.scale > 1.5 && b.doZoomIn(e), e.scale < .8 && b.doZoomOut(e), b.cancelEvent(e) 372 }, b.bind(b.win, "gestureend", b.ongesturezoom))), b.railh = !1; 373 var w; 374 if (b.opt.horizrailenabled && (b.css(i, {overflowX: "hidden"}), (l = s(document.createElement("div"))).css({ 375 position: "absolute", 376 top: 0, 377 height: b.opt.cursorwidth, 378 width: 0, 379 backgroundColor: b.opt.cursorcolor, 380 border: b.opt.cursorborder, 381 backgroundClip: "padding-box", 382 "-webkit-border-radius": b.opt.cursorborderradius, 383 "-moz-border-radius": b.opt.cursorborderradius, 384 "border-radius": b.opt.cursorborderradius 385 }), z.isieold && l.css("overflow", "hidden"), l.wborder = parseFloat(l.outerWidth() - l.innerWidth()), l.addClass("nicescroll-cursors"), b.cursorh = l, (w = s(document.createElement("div"))).attr("id", b.id + "-hr"), w.addClass("nicescroll-rails nicescroll-rails-hr"), w.height = Math.max(parseFloat(b.opt.cursorwidth), l.outerHeight()), w.css({ 386 height: w.height + "px", 387 zIndex: b.zindex, 388 background: b.opt.background 389 }), w.append(l), w.visibility = !0, w.scrollable = !0, w.align = "top" == b.opt.railvalign ? 0 : 1, b.railh = w, b.railh.drag = !1), b.ispage) a.css({ 390 position: "fixed", 391 top: 0, 392 height: "100%" 393 }), a.align ? a.css({right: 0}) : a.css({left: 0}), b.body.append(a), b.railh && (w.css({ 394 position: "fixed", 395 left: 0, 396 width: "100%" 397 }), w.align ? w.css({bottom: 0}) : w.css({top: 0}), b.body.append(w)); else { 398 if (b.ishwscroll) { 399 "static" == b.win.css("position") && b.css(b.win, {position: "relative"}); 400 var v = "HTML" == b.win[0].nodeName ? b.body : b.win; 401 s(v).scrollTop(0).scrollLeft(0), b.zoom && (b.zoom.css({ 402 position: "absolute", 403 top: 1, 404 right: 0, 405 "margin-right": a.width + 4 406 }), v.append(b.zoom)), a.css({ 407 position: "absolute", 408 top: 0 409 }), a.align ? a.css({right: 0}) : a.css({left: 0}), v.append(a), w && (w.css({ 410 position: "absolute", 411 left: 0, 412 bottom: 0 413 }), w.align ? w.css({bottom: 0}) : w.css({top: 0}), v.append(w)) 414 } else { 415 b.isfixed = "fixed" == b.win.css("position"); 416 var y = b.isfixed ? "fixed" : "absolute"; 417 b.isfixed || (b.viewport = b.getViewport(b.win[0])), b.viewport && (b.body = b.viewport,
4170 == /fixed|absolute/.test(b.viewport.css("position")) && b.css(b.viewport, {position: "relative"})), a.css({position: y}), b.zoom && b.zoom.css({position: y}), b.updateScrollBar(), b.body.append(a), b.zoom && b.body.append(b.zoom), b.railh && (w.css({position: y}), b.body.append(w)) 418 } 419 z.isios && b.css(b.win, { 420 "-webkit-tap-highlight-color": "rgba(0,0,0,0)", 421 "-webkit-touch-callout": "none" 422 }), z.isie && b.opt.disableoutline && b.win.attr("hideFocus", "true"), z.iswebkit && b.opt.disableoutline && b.win.css("outline", "none") 423 } 424 if (!1 === b.opt.autohidemode ? (b.autohidedom = !1, b.rail.css({opacity: b.opt.cursoropacitymax}), b.railh && b.railh.css({opacity: b.opt.cursoropacitymax})) : !0 === b.opt.autohidemode || "leave" === b.opt.autohidemode ? (b.autohidedom = s().add(b.rail), z.isie8 && (b.autohidedom = b.autohidedom.add(b.cursor)), b.railh && (b.autohidedom = b.autohidedom.add(b.railh)), b.railh && z.isie8 && (b.autohidedom = b.autohidedom.add(b.cursorh))) : "scroll" == b.opt.autohidemode ? (b.autohidedom = s().add(b.rail), b.railh && (b.autohidedom = b.autohidedom.add(b.railh))) : "cursor" == b.opt.autohidemode ? (b.autohidedom = s().add(b.cursor), b.railh && (b.autohidedom = b.autohidedom.add(b.cursorh))) : "hidden" == b.opt.autohidemode && (b.autohidedom = !1, b.hide(), b.railslocked = !1), z.isie9mobile) { 425 b.scrollmom = new m(b), b.onmangotouch = function () { 426 var e = b.getScrollTop(), o = b.getScrollLeft(); 427 if (e == b.scrollmom.lastscrolly && o == b.scrollmom.lastscrollx) return !0; 428 var t = e - b.mangotouch.sy, r = o - b.mangotouch.sx; 429 if (0 != Math.round(Math.sqrt(Math.pow(r, 2) + Math.pow(t, 2)))) { 430 var i = t < 0 ? -1 : 1, n = r < 0 ? -1 : 1, s = +new Date; 431 if (b.mangotouch.lazy && clearTimeout(b.mangotouch.lazy), s - b.mangotouch.tm > 80 || b.mangotouch.dry != i || b.mangotouch.drx != n) b.scrollmom.stop(), b.scrollmom.reset(o, e), b.mangotouch.sy = e, b.mangotouch.ly = e, b.mangotouch.sx = o, b.mangotouch.lx = o, b.mangotouch.dry = i, b.mangotouch.drx = n, b.mangotouch.tm = s; else { 432 b.scrollmom.stop(), b.scrollmom.update(b.mangotouch.sx - r, b.mangotouch.sy - t), b.mangotouch.tm = s; 433 var l = Math.max(Math.abs(b.mangotouch.ly - e), Math.abs(b.mangotouch.lx - o)); 434 b.mangotouch.ly = e, b.mangotouch.lx = o, l > 2 && (b.mangotouch.lazy = setTimeout(function () { 435 b.mangotouch.lazy = !1, b.mangotouch.dry = 0, b.mangotouch.drx = 0, b.mangotouch.tm = 0, b.scrollmom.doMomentum(30) 436 }, 100)) 437 } 438 } 439 }; 440 var x = b.getScrollTop(), S = b.getScrollLeft(); 441 b.mangotouch = { 442 sy: x, 443 ly: x, 444 dry: 0, 445 sx: S, 446 lx: S, 447 drx: 0, 448 lazy: !1, 449 tm: 0 450 }, b.bind(b.docscroll, "scroll", b.onmangotouch) 451 } else { 452 if (z.cantouch || b.istouchcapable || b.opt.emulatetouch || z.hasmstouch) { 453 b.scrollmom = new m(b), b.ontouchstart = function (e) { 454 if (e.pointerType && 2 != e.pointerType && "touch" != e.pointerType) return !1; 455 if (b.hasmoving = !1, !b.railslocked) { 456 var o; 457 if (z.hasmstouch) for (o = !!e.target && e.target; o;) { 458 var t = s(o).getNiceScroll(); 459 if (t.length > 0 && t[0].me == b.me) break; 460 if (t.length > 0) return !1; 461 if ("DIV" == o.nodeName && o.id == b.id) break; 462 o = !!o.parentNode && o.parentNode 463 } 464 if (b.cancelScroll(), (o = b.getTarget(e)) && /INPUT/i.test(o.nodeName) && /range/i.test(o.type)) return b.stopPropagation(e); 465 if (!("clientX" in e) && "changedTouches" in e && (e.clientX = e.changedTouches[0].clientX, e.clientY = e.changedTouches[0].clientY), b.forcescreen) { 466 var r = e; 467 (e = {original: e.original ? e.original : e}).clientX = r.screenX, e.clientY = r.screenY 468 } 469 if (b.rail.drag = { 470 x: e.clientX, 471 y: e.clientY, 472 sx: b.scroll.x, 473 sy: b.scroll.y, 474 st: b.getScrollTop(), 475 sl: b.getScrollLeft(), 476 pt: 2, 477 dl: !1, 478 tg: o 479 }, b.ispage || !b.opt.directionlockdeadzone) b.rail.drag.dl = "f"; else { 480 var i = {w: s(window).width(), h: s(window).height()}, n = { 481 w: Math.max(document.body.scrollWidth, document.documentElement.scrollWidth), 482 h: Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) 483 }, l = Math.max(0, n.h - i.h), a = Math.max(0, n.w - i.w); 484 !b.rail.scrollable && b.railh.scrollable ? b.rail.drag.ck = l > 0 && "v" : b.rail.scrollable && !b.railh.scrollable ? b.rail.drag.ck = a > 0 && "h" : b.rail.drag.ck = !1, b.rail.drag.ck || (b.rail.drag.dl = "f") 485 } 486 if (b.opt.emulatetouch && b.isiframe && z.isie) { 487 var c = b.win.position(); 488 b.rail.drag.x += c.left, b.rail.drag.y += c.top 489 } 490 if (b.hasmoving = !1, b.lastmouseup = !1, b.scrollmom.reset(e.clientX, e.clientY), !z.cantouch && !this.istouchcapable && !e.pointerType) { 491 if (!(!!o && /INPUT|SELECT|BUTTON|TEXTAREA/i.test(o.nodeName))) return !b.ispage && z.hasmousecapture && o.setCapture(), b.opt.emulatetouch ? (o.onclick && !o._onclick && (
491o._onclick = o.onclick, o.onclick = function (e) { 492 if (b.hasmoving) return !1; 493 o._onclick.call(this, e) 494 }), b.cancelEvent(e)) : b.stopPropagation(e); 495 /SUBMIT|CANCEL|BUTTON/i.test(s(o).attr("type")) && (b.preventclick = {tg: o, click: !1}) 496 } 497 } 498 }, b.ontouchend = function (e) { 499 if (!b.rail.drag) return !0; 500 if (2 == b.rail.drag.pt) { 501 if (e.pointerType && 2 != e.pointerType && "touch" != e.pointerType) return !1; 502 if (!b.hasmoving) { 503 var o = b.rail.drag.tg; 504 setTimeout(function () { 505 o && s(o).trigger("click") 506 }, 20) 507 } 508 if (b.rail.drag = !1, b.hasmoving && (b.scrollmom.doMomentum(), b.lastmouseup = !0, b.hideCursor(), z.hasmousecapture && document.releaseCapture(), !z.cantouch)) return b.cancelEvent(e) 509 } else if (1 == b.rail.drag.pt) return b.onmouseup(e) 510 }; 511 var T = b.opt.emulatetouch && b.isiframe && !z.hasmousecapture; 512 b.ontouchmove = function (e, o) { 513 if (!b.rail.drag) return !1; 514 if (e.targetTouches && b.opt.preventmultitouchscrolling && e.targetTouches.length > 1) return !1; 515 if (e.pointerType && 2 != e.pointerType && "touch" != e.pointerType) return !1; 516 if (z.isandroid && b.cancelEvent(e), 2 == b.rail.drag.pt) { 517 if ("changedTouches" in (e = s.extend({original: e}, e)) && (e.clientX = e.changedTouches[0].clientX, e.clientY = e.changedTouches[0].clientY), b.forcescreen) { 518 var t = e; 519 (e = {original: e.original ? e.original : e}).clientX = t.screenX, e.clientY = t.screenY 520 } 521 if (b.rail.drag.y === e.clientY && b.rail.drag.x === e.clientX) return !1; 522 b.hasmoving = !0, b.preventclick && !b.preventclick.click && (b.preventclick.click = b.preventclick.tg.onclick || !1, b.preventclick.tg.onclick = b.onpreventclick); 523 var r, i; 524 if (i = r = 0, T && !o) { 525 var n = b.win.position(); 526 i = -n.left, r = -n.top 527 } 528 var l = e.clientY + r, a = l - b.rail.drag.y, c = e.clientX + i, d = c - b.rail.drag.x, 529 u = b.rail.drag.st - a; 530 b.ishwscroll && b.opt.bouncescroll ? u < 0 ? u = Math.round(u / 2) : u > b.page.maxh && (u = b.page.maxh + Math.round((u - b.page.maxh) / 2)) : (u < 0 && (u = 0, l = 0), u > b.page.maxh && (u = b.page.maxh, l = 0)); 531 var h; 532 b.railh && b.railh.scrollable && (h = b.isrtlmode ? d - b.rail.drag.sl : b.rail.drag.sl - d, b.ishwscroll && b.opt.bouncescroll ? h < 0 ? h = Math.round(h / 2) : h > b.page.maxw && (h = b.page.maxw + Math.round((h - b.page.maxw) / 2)) : (h < 0 && (h = 0, c = 0), h > b.page.maxw && (h = b.page.maxw, c = 0))); 533 var p = !1; 534 if (b.rail.drag.dl) p = !0, "v" == b.rail.drag.dl ? h = b.rail.drag.sl : "h" == b.rail.drag.dl && (u = b.rail.drag.st); else { 535 var m = Math.abs(a), f = Math.abs(d), g = b.opt.directionlockdeadzone; 536 if ("v" == b.rail.drag.ck) { 537 if (m > g && f <= .3 * m) return b.rail.drag = !1, !0; 538 f > g && (b.rail.drag.dl = "f", s("body").scrollTop(s("body").scrollTop())) 539 } else if ("h" == b.rail.drag.ck) { 540 if (f > g && m <= .3 * f) return b.rail.drag = !1, !0; 541 m > g && (b.rail.drag.dl = "f", s("body").scrollLeft(s("body").scrollLeft())) 542 } 543 } 544 if (b.synched("touchmove", function () { 545 b.rail.drag && 2 == b.rail.drag.pt && (b.prepareTransition && b.prepareTransition(0), b.rail.scrollable && b.setScrollTop(u), b.scrollmom.update(c, l), b.railh && b.railh.scrollable ? (b.setScrollLeft(h), b.showCursor(u, h)) : b.showCursor(u), z.isie10 && document.selection.clear()) 546 }), z.ischrome && b.istouchcapable && (p = !1), p) return b.cancelEvent(e) 547 } else if (1 == b.rail.drag.pt) return b.onmousemove(e) 548 }, b.ontouchstartCursor = function (e, o) { 549 if (!b.rail.drag || 3 == b.rail.drag.pt) { 550 if (b.locked) return b.cancelEvent(e); 551 b.cancelScroll(), b.rail.drag = { 552 x: e.touches[0].clientX, 553 y: e.touches[0].clientY, 554 sx: b.scroll.x, 555 sy: b.scroll.y, 556 pt: 3, 557 hr: !!o 558 }; 559 var t = b.getTarget(e); 560 return !b.ispage && z.hasmousecapture && t.setCapture(), b.isiframe && !z.hasmousecapture && (b.saved.csspointerevents = b.doc.css("pointer-events"), b.css(b.doc, {"pointer-events": "none"})), b.cancelEvent(e) 561 } 562 }, b.ontouchendCursor = function (e) { 563 if (b.rail.drag) { 564 if (z.hasmousecapture && document.releaseCapture(), b.isiframe && !z.hasmousecapture && b.doc.css("pointer-events", b.saved.csspointerevents), 3 != b.rail.drag.pt) return; 565 return b.rail.drag = !1, b.cancelEvent(e) 566 } 567 }, b.ontouchmoveCursor = function (e) { 568 if (b.rail.drag) { 569 if (3 != b.rail.drag.pt) return; 570 if (b.cursorfreezed = !0, b.rail.drag.hr) { 571 b.scroll.x = b.rail.drag.sx + (e.touches[0].clientX - b.rail.drag.x), b.scroll.x < 0 && (b.scroll.x = 0); 572 var o = b.scrollvaluemaxw; 573 b.scroll.x > o && (b.scroll.x = o) 574 } else { 575 b.scroll.y = b.rail.drag.sy + (e.touches[0].clientY - b.rail.drag.y), b.scroll.y < 0 && (b.scroll.y = 0); 576 var t = b.scrollvaluemax; 577 b.scroll.y > t && (b.scroll.y = t) 578 } 579 return b.synched("touchmove", function () { 580 b.rail.drag && 3 == b.rail.drag.pt && (b.showCursor(), b.rail.drag.hr ? b.doScrollLeft(Math.round(b.scroll.x * b.scrollratio.x), b.opt.cursordragspeed) : b.doScrollTop(Math.round(b.scroll.y * b.scrollratio.y), b.opt.cursordragspeed)) 581 }), b.cancelEvent(e) 582 } 583 } 584 } 585 if (b.onmousedown = function (e, o) { 586 if (!b.rail.drag || 1 == b.rail.drag.pt) { 587 if (b.railslocked) return b.cancelEvent(e); 588 b.cancelScroll(), b.rail.drag = { 589 x: e.clientX, 590 y: e.clientY, 591 sx: b.scroll.x, 592 sy: b.scroll.y, 593 pt: 1, 594 hr: o || !1 595 }; 596 var t = b.getTarget(e); 597 return !b.ispage && z.hasmousecapture && t.setCapture(), b.isiframe && !z.hasmousecapture && (b.saved.csspointerevents = b.doc.css("pointer-events"), b.css(b.doc, {"pointer-events": "none"})), b.hasmoving = !1, b.cancelEvent(e) 598 } 599 }, b.onmouseup = function (e) { 600 if (b.rail.drag) return 1 != b.rail.drag.pt || (z.hasmousecapture && document.releaseCapture(), b.isiframe && !z.hasmousecapture && b.doc.css("pointer-events", b.saved.csspointerevents), b.rail.drag = !1, b.hasmoving && b.triggerScrollEnd(), b.cancelEvent(e)) 601 }, b.onmousemove = function (e) { 602 if (b.rail.drag) { 603 if (1 !== b.rail.drag.pt) return; 604 if (z.ischrome && 0 === e.which) return b.onmouseup(e); 605 if (b.cursorfreezed = !0, b.hasmoving = !0, b.rail.drag.hr) { 606 b.scroll.x = b.rail.drag.sx + (e.clientX - b.rail.drag.x), b.scroll.x < 0 && (b.scroll.x = 0); 607 var o = b.scrollvaluemaxw; 608 b.scroll.x > o && (b.scroll.x = o) 609 } else { 610 b.scroll.y = b.rail.drag.sy + (e.clientY - b.rail.drag.y), b.scroll.y < 0 && (b.scroll.y = 0); 611 var t = b.scrollvaluemax; 612 b.scroll.y > t && (b.scroll.y = t) 613 } 614 return b.synched("mousemove", function () { 615 b.rail.drag && 1 == b.rail.drag.pt && (b.showCursor(), b.rail.drag.hr ? b.hasreversehr ? b.doScrollLeft(b.scrollvaluemaxw - Math.round(b.scroll.x * b.scrollratio.x), b.opt.cursordragspeed) : b.doScrollLeft(Math.round(b.scroll.x * b.scrollratio.x), b.opt.cursordragspeed) : b.doScrollTop(Math.round(b.scroll.y * b.scrollratio.y), b.opt.cursordragspeed)) 616 }), b.cancelEvent(e) 617 } 618 b.checkarea = 0 619 }, z.cantouch || b.opt.emulatetouch) b.onpreventclick = function (e) {
vendor: 10,723 bytes, lines 620-775
620 if (b.preventclick) return b.preventclick.tg.onclick = b.preventclick.click, b.preventclick = !1, b.cancelEvent(e) 621 }, b.onclick = !z.isios && function (e) { 622 return !b.lastmouseup || (b.lastmouseup = !1, b.cancelEvent(e)) 623 }, b.opt.grabcursorenabled && z.cursorgrabvalue && (b.css(b.ispage ? b.doc : b.win, {cursor: z.cursorgrabvalue}), b.css(b.rail, {cursor: z.cursorgrabvalue})); else { 624 var k = function (e) { 625 if (b.selectiondrag) { 626 if (e) { 627 var o = b.win.outerHeight(), t = e.pageY - b.selectiondrag.top; 628 t > 0 && t < o && (t = 0), t >= o && (t -= o), b.selectiondrag.df = t 629 } 630 if (0 != b.selectiondrag.df) { 631 var r = 2 * -Math.floor(b.selectiondrag.df / 6); 632 b.doScrollBy(r), b.debounced("doselectionscroll", function () { 633 k() 634 }, 50) 635 } 636 } 637 }; 638 "getSelection" in document ? b.hasTextSelected = function () { 639 return document.getSelection().rangeCount > 0 640 } : "selection" in document ? b.hasTextSelected = function () { 641 return "None" != document.selection.type 642 } : b.hasTextSelected = function () { 643 return !1 644 }, b.onselectionstart = function (e) { 645 b.ispage || (b.selectiondrag = b.win.offset()) 646 }, b.onselectionend = function (e) { 647 b.selectiondrag = !1 648 }, b.onselectiondrag = function (e) { 649 b.selectiondrag && b.hasTextSelected() && b.debounced("selectionscroll", function () { 650 k(e) 651 }, 250) 652 } 653 } 654 z.hasw3ctouch ? (b.css(b.ispage ? s("html") : b.win, {"touch-action": "none"}), b.css(b.rail, {"touch-action": "none"}), b.css(b.cursor, {"touch-action": "none"}), b.bind(b.win, "pointerdown", b.ontouchstart), b.bind(document, "pointerup", b.ontouchend), b.bind(document, "pointermove", b.ontouchmove)) : z.hasmstouch ? (b.css(b.ispage ? s("html") : b.win, {"-ms-touch-action": "none"}), b.css(b.rail, {"-ms-touch-action": "none"}), b.css(b.cursor, {"-ms-touch-action": "none"}), b.bind(b.win, "MSPointerDown", b.ontouchstart), b.bind(document, "MSPointerUp", b.ontouchend), b.bind(document, "MSPointerMove", b.ontouchmove), b.bind(b.cursor, "MSGestureHold", function (e) { 655 e.preventDefault() 656 }), b.bind(b.cursor, "contextmenu", function (e) { 657 e.preventDefault() 658 })) : z.cantouch && (b.bind(b.win, "touchstart", b.ontouchstart, !1, !0), b.bind(document, "touchend", b.ontouchend, !1, !0), b.bind(document, "touchcancel", b.ontouchend, !1, !0), b.bind(document, "touchmove", b.ontouchmove, !1, !0)), b.opt.emulatetouch && (b.bind(b.win, "mousedown", b.ontouchstart, !1, !0), b.bind(document, "mouseup", b.ontouchend, !1, !0), b.bind(document, "mousemove", b.ontouchmove, !1, !0)), (b.opt.cursordragontouch || !z.cantouch && !b.opt.emulatetouch) && (b.rail.css({cursor: "default"}), b.railh && b.railh.css({cursor: "default"}), b.jqbind(b.rail, "mouseenter", function () { 659 if (!b.ispage && !b.win.is(":visible")) return !1; 660 b.canshowonmouseevent && b.showCursor(), b.rail.active = !0 661 }), b.jqbind(b.rail, "mouseleave", function () { 662 b.rail.active = !1, b.rail.drag || b.hideCursor() 663 }), b.opt.sensitiverail && (b.bind(b.rail, "click", function (e) { 664 b.doRailClick(e, !1, !1) 665 }), b.bind(b.rail, "dblclick", function (e) { 666 b.doRailClick(e, !0, !1) 667 }), b.bind(b.cursor, "click", function (e) { 668 b.cancelEvent(e) 669 }), b.bind(b.cursor, "dblclick", function (e) { 670 b.cancelEvent(e) 671 })), b.railh && (b.jqbind(b.railh, "mouseenter", function () { 672 if (!b.ispage && !b.win.is(":visible")) return !1; 673 b.canshowonmouseevent && b.showCursor(), b.rail.active = !0 674 }), b.jqbind(b.railh, "mouseleave", function () { 675 b.rail.active = !1, b.rail.drag || b.hideCursor() 676 }), b.opt.sensitiverail && (b.bind(b.railh, "click", function (e) { 677 b.doRailClick(e, !1, !0) 678 }), b.bind(b.railh, "dblclick", function (e) { 679 b.doRailClick(e, !0, !0) 680 }), b.bind(b.cursorh, "click", function (e) { 681 b.cancelEvent(e) 682 }), b.bind(b.cursorh, "dblclick", function (e) { 683 b.cancelEvent(e) 684 })))), b.opt.cursordragontouch && (this.istouchcapable || z.cantouch) && (b.bind(b.cursor, "touchstart", b.ontouchstartCursor), b.bind(b.cursor, "touchmove", b.ontouchmoveCursor), b.bind(b.cursor, "touchend", b.ontouchendCursor), b.cursorh && b.bind(b.cursorh, "touchstart", function (e) { 685 b.ontouchstartCursor(e, !0) 686 }), b.cursorh && b.bind(b.cursorh, "touchmove", b.ontouchmoveCursor), b.cursorh && b.bind(b.cursorh, "touchend", b.ontouchendCursor)), z.cantouch || b.opt.emulatetouch ? (b.bind(z.hasmousecapture ? b.win : document, "mouseup", b.ontouchend), b.onclick && b.bind(document, "click", b.onclick), b.opt.cursordragontouch ? (b.bind(b.cursor, "mousedown", b.onmousedown), b.bind(b.cursor, "mouseup", b.onmouseup), b.cursorh && b.bind(b.cursorh, "mousedown", function (e) { 687 b.onmousedown(e, !0) 688 }), b.cursorh && b.bind(b.cursorh, "mouseup", b.onmouseup)) : (b.bind(b.rail, "mousedown", function (e) { 689 e.preventDefault() 690 }), b.railh && b.bind(b.railh, "mousedown", function (e) { 691 e.preventDefault() 692 }))) : (b.bind(z.hasmousecapture ? b.win : document, "mouseup", b.onmouseup), b.bind(document, "mousemove", b.onmousemove), b.onclick && b.bind(document, "click", b.onclick), b.bind(b.cursor, "mousedown", b.onmousedown), b.bind(b.cursor, "mouseup", b.onmouseup), b.railh && (b.bind(b.cursorh, "mousedown", function (e) { 693 b.onmousedown(e, !0) 694 }), b.bind(b.cursorh, "mouseup", b.onmouseup)), !b.ispage && b.opt.enablescrollonselection && (b.bind(b.win[0], "mousedown", b.onselectionstart), b.bind(document, "mouseup", b.onselectionend), b.bind(b.cursor, "mouseup", b.onselectionend), b.cursorh && b.bind(b.cursorh, "mouseup", b.onselectionend), b.bind(document, "mousemove", b.onselectiondrag)), b.zoom && (b.jqbind(b.zoom, "mouseenter", function () { 695 b.canshowonmouseevent && b.showCursor(), b.rail.active = !0 696 }), b.jqbind(b.zoom, "mouseleave", function () { 697 b.rail.active = !1, b.rail.drag || b.hideCursor() 698 }))), b.opt.enablemousewheel && (b.isiframe || b.mousewheel(z.isie && b.ispage ? document : b.win, b.onmousewheel), b.mousewheel(b.rail, b.onmousewheel), b.railh && b.mousewheel(b.railh, b.onmousewheelhr)), b.ispage || z.cantouch || /HTML|^BODY/.test(b.win[0].nodeName) || (b.win.attr("tabindex") || b.win.attr({tabindex: r++}), b.jqbind(b.win, "focus", function (e) { 699 o = b.getTarget(e).id || !0, b.hasfocus = !0, b.canshowonmouseevent && b.noticeCursor() 700 }), b.jqbind(b.win, "blur", function (e) { 701 o = !1, b.hasfocus = !1 702 }), b.jqbind(b.win, "mouseenter", function (e) { 703 t = b.getTarget(e).id || !0, b.hasmousefocus = !0, b.canshowonmouseevent && b.noticeCursor() 704 }), b.jqbind(b.win, "mouseleave", function () { 705 t = !1, b.hasmousefocus = !1, b.rail.drag || b.hideCursor() 706 })) 707 } 708 if (b.onkeypress = function (e) { 709 if (b.railslocked && 0 == b.page.maxh) return !0; 710 e = e || window.e; 711 var r = b.getTarget(e); 712 if (r && /INPUT|TEXTAREA|SELECT|OPTION/.test(r.nodeName) && (!(r.getAttribute("type") || r.type || !1) || !/submit|button|cancel/i.tp)) return !0; 713 if (s(r).attr("contenteditable")) return !0; 714 if (b.hasfocus || b.hasmousefocus && !o || b.ispage && !o && !t) { 715 var i = e.keyCode; 716 if (b.railslocked && 27 != i) return b.cancelEvent(e); 717 var n = e.ctrlKey || !1, l = e.shiftKey || !1, a = !1; 718 switch (i) { 719 case 38: 720 case 63233: 721 b.doScrollBy(72), a = !0; 722 break; 723 case 40: 724 case 63235: 725 b.doScrollBy(-72), a = !0; 726 break; 727 case 37: 728 case 63232: 729 b.railh && (n ? b.doScrollLeft(0) : b.doScrollLeftBy(72), a = !0); 730 break; 731 case 39: 732 case 63234: 733 b.railh && (n ? b.doScrollLeft(b.page.maxw) : b.doScrollLeftBy(-72), a = !0); 734 break; 735 case 33: 736 case 63276: 737 b.doScrollBy(b.view.h), a = !0; 738 break; 739 case 34: 740 case 63277: 741 b.doScrollBy(-b.view.h), a = !0; 742 break; 743 case 36: 744 case 63273: 745 b.railh && n ? b.doScrollPos(0, 0) : b.doScrollTo(0), a = !0; 746 break; 747 case 35: 748 case 63275: 749 b.railh && n ? b.doScrollPos(b.page.maxw, b.page.maxh) : b.doScrollTo(b.page.maxh), a = !0; 750 break; 751 case 32: 752 b.opt.spacebarenabled && (l ? b.doScrollBy(b.view.h) : b.doScrollBy(-b.view.h), a = !0); 753 break; 754 case 27: 755 b.zoomactive && (b.doZoom(), a = !0) 756 } 757 if (a) return b.cancelEvent(e) 758 } 759 }, b.opt.enablekeyboard && b.bind(document, z.isopera && !z.isopera12 ? "keypress" : "keydown", b.onkeypress), b.bind(document, "keydown", function (e) { 760 (e.ctrlKey || !1) && (b.wheelprevented = !0) 761 }), b.bind(document, "keyup", function (e) { 762 e.ctrlKey || !1 || (b.wheelprevented = !1) 763 }), b.bind(window, "blur", function (e) { 764 b.wheelprevented = !1 765 }), b.bind(window, "resize", b.lazyResize), b.bind(window, "orientationchange", b.lazyResize), b.bind(window, "load", b.lazyResize), z.ischrome && !b.ispage && !b.haswrapper) { 766 var M = b.win.attr("style"), E = parseFloat(b.win.css("width")) + 1; 767 b.win.css("width", E), b.synched("chromefix", function () { 768 b.win.attr("style", M) 769 }) 770 } 771 b.onAttributeChange = function (e) { 772 b.lazyResize(b.isieold ? 250 : 30) 773 }, b.opt.enableobserver && (b.isie11 || !1 === c || (b.observerbody = new c(function (e) { 774 if (e.forEach(function (e) { 775 if ("attributes" == e.type) return s("body").hasClass("modal-open") && s("body").hasClass("modal-dialog") && !s.contains(s(".modal
775-dialog")[0], b.doc[0]) ? b.hide() : b.show() 776 }), b.me.clientWidth != b.page.width || b.me.clientHeight != b.page.height) return b.lazyResize(30) 777 }), b.observerbody.observe(document.body, { 778 childList: !0, 779 subtree: !0, 780 characterData: !1, 781 attributes: !0, 782 attributeFilter: ["class"] 783 })), b.ispage || b.haswrapper || (!1 !== c ? (b.observer = new c(function (e) { 784 e.forEach(b.onAttributeChange) 785 }), b.observer.observe(b.win[0], { 786 childList: !0, 787 characterData: !1, 788 attributes: !0, 789 subtree: !1 790 }), b.observerremover = new c(function (e) { 791 e.forEach(function (e) { 792 if (e.removedNodes.length > 0) for (var o in e.removedNodes) if (b && e.removedNodes[o] == b.win[0]) return b.remove() 793 }) 794 }), b.observerremover.observe(b.win[0].parentNode, { 795 childList: !0, 796 characterData: !1, 797 attributes: !1, 798 subtree: !1 799 })) : (b.bind(b.win, z.isie && !z.isie9 ? "propertychange" : "DOMAttrModified", b.onAttributeChange), z.isie9 && b.win[0].attachEvent("onpropertychange", b.onAttributeChange), b.bind(b.win, "DOMNodeRemoved", function (e) { 800 e.target == b.win[0] && b.remove() 801 })))), !b.ispage && b.opt.boxzoom && b.bind(window, "resize", b.resizeZoom), b.istextarea && (b.bind(b.win, "keydown", b.lazyResize), b.bind(b.win, "mouseup", b.lazyResize)), b.lazyResize(30) 802 } 803 if ("IFRAME" == this.doc[0].nodeName) { 804 var L = function () { 805 b.iframexd = !1; 806 var o; 807 try { 808 (o = "contentDocument" in this ? this.contentDocument : this.contentWindow.document).domain 809 } catch (e) { 810 b.iframexd = !0, o = !1 811 } 812 if (b.iframexd) return "console" in window && console.log("NiceScroll error: policy restriced iframe"), !0; 813 if (b.forcescreen = !0, b.isiframe && (b.iframe = { 814 doc: s(o), 815 html: b.doc.contents().find("html")[0], 816 body: b.doc.contents().find("body")[0] 817 }, b.getContentSize = function () { 818 return {
819 w: Math.max(b.iframe.html.scrollWidth, b.iframe.body.scrollWidth), 820 h: Math.max(b.iframe.html.scrollHeight, b.iframe.body.scrollHeight) 821 } 822 }, b.docscroll = s(b.iframe.body)), !z.isios && b.opt.iframeautoresize && !b.isiframe) { 823 b.win.scrollTop(0), b.doc.height(""); 824 var t = Math.max(o.getElementsByTagName("html")[0].scrollHeight, o.body.scrollHeight); 825 b.doc.height(t) 826 } 827 b.lazyResize(30), z.isie7 && b.css(s(b.iframe.html), e), b.css(s(b.iframe.body), e), z.isios && b.haswrapper && b.css(s(o.body), {"-webkit-transform": "translate3d(0,0,0)"}), "contentWindow" in this ? b.bind(this.contentWindow, "scroll", b.onscroll) : b.bind(o, "scroll", b.onscroll), b.opt.enablemousewheel && b.mousewheel(o, b.onmousewheel), b.opt.enablekeyboard && b.bind(o, z.isopera ? "keypress" : "keydown", b.onkeypress), z.cantouch ? (b.bind(o, "touchstart", b.ontouchstart), b.bind(o, "touchmove", b.ontouchmove)) : b.opt.emulatetouch && (b.bind(o, "mousedown", b.ontouchstart), b.bind(o, "mousemove", function (e) { 828 return b.ontouchmove(e, !0) 829 }), b.opt.grabcursorenabled && z.cursorgrabvalue && b.css(s(o.body), {cursor: z.cursorgrabvalue})), b.bind(o, "mouseup", b.ontouchend), b.zoom && (b.opt.dblclickzoom && b.bind(o, "dblclick", b.doZoom), b.ongesturezoom && b.bind(o, "gestureend", b.ongesturezoom)) 830 }; 831 this.doc[0].readyState && "complete" == this.doc[0].readyState && setTimeout(function () { 832 L.call(b.doc[0], !1) 833 }, 500), b.bind(this.doc, "load", L) 834 } 835 }, this.showCursor = function (e, o) { 836 if (b.cursortimeout && (clearTimeout(b.cursortimeout), b.cursortimeout = 0), b.rail) { 837 if (b.autohidedom && (b.autohidedom.stop().css({opacity: b.opt.cursoropacitymax}), b.cursoractive = !0), b.rail.drag && 1 == b.rail.drag.pt || (void 0 !== e && !1 !== e && (b.scroll.y = Math.round(1 * e / b.scrollratio.y)), void 0 !== o && (b.scroll.x = Math.round(1 * o / b.scrollratio.x))), b.cursor.css({ 838 height: b.cursorheight, 839 top: b.scroll.y 840 }), b.cursorh) { 841 var t = b.hasreversehr ? b.scrollvaluemaxw - b.scroll.x : b.scroll.x; 842 !b.rail.align && b.rail.visibility ? b.cursorh.css({ 843 width: b.cursorwidth, 844 left: t + b.rail.width 845 }) : b.cursorh.css({width: b.cursorwidth, left: t}), b.cursoractive = !0 846 } 847 b.zoom && b.zoom.stop().css({opacity: b.opt.cursoropacitymax}) 848 } 849 }, this.hideCursor = function (e) { 850 b.cursortimeout || b.rail && b.autohidedom && (b.hasmousefocus && "leave" == b.opt.autohidemode || (b.cursortimeout = setTimeout(function () { 851 b.rail.active && b.showonmouseevent || (b.autohidedom.stop().animate({opacity: b.opt.cursoropacitymin}), b.zoom && b.zoom.stop().animate({opacity: b.opt.cursoropacitymin}), b.cursoractive = !1), b.cursortimeout = 0 852 }, e || b.opt.hidecursordelay))) 853 }, this.noticeCursor = function (e, o, t) { 854 b.showCursor(o, t), b.rail.active || b.hideCursor(e) 855 }, this.getContentSize = b.ispage ? function () { 856 return { 857 w: Math.max(document.body.scrollWidth, document.documentElement.scrollWidth), 858 h: Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) 859 } 860 } : b.haswrapper ? function () { 861 return { 862 w: b.doc.outerWidth() + parseInt(b.win.css("paddingLeft")) + parseInt(b.win.css("paddingRight")), 863 h: b.doc.outerHeight() + parseInt(b.win.css("paddingTop")) + parseInt(b.win.css("paddingBottom")) 864 } 865 } : function () { 866 return {w: b.docscroll[0].scrollWidth, h: b.docscroll[0].scrollHeight} 867 }, this.onResize = function (e, o) { 868 if (!b || !b.win) return !1; 869 if (!b.haswrapper && !b.ispage) { 870 if ("none" == b.win.css("display")) return b.visibility && b.hideRail().hideRailHr(), !1; 871 b.hidden || b.visibility || b.showRail().showRailHr() 872 } 873 var t = b.page.maxh, r = b.page.maxw, i = {h: b.view.h, w: b.view.w}; 874 if (b.view = { 875 w: b.ispage ? b.win.width() : parseInt(b.win[0].clientWidth), 876 h: b.ispage ? b.win.height() : parseInt(b.win[0].clientHeight) 877 }, b.page = o || b.getContentSize(), b.page.maxh = Math.max(0, b.page.h - b.view.h), b.page.maxw = Math.max(0, b.page.w - b.view.w), b.page.maxh == t && b.page.maxw == r && b.view.w == i.w && b.view.h == i.h) { 878 if (b.ispage) return b; 879 var n = b.win.offset(); 880 if (b.lastposition) { 881 var s = b.lastposition; 882 if (s.top == n.top && s.left == n.left) return b 883 } 884 b.lastposition = n 885 } 886 return 0 == b.page.maxh ? (b.hideRail(), b.scrollvaluemax = 0, b.scroll.y = 0, b.scrollratio.y = 0, b.cursorheight = 0, b.setScrollTop(0), b.rail && (b.rail.scrollable = !1)) : (b.page.maxh -= b.opt.railpadding.top + b.opt.railpadding.bottom, b.rail.scrollable = !0), 0 == b.page.maxw ? (b.hideRailHr(), b.scrollvaluemaxw = 0, b.scroll.x = 0, b.scrollratio.x = 0, b.cursorwidth = 0, b.setScrollLeft(0), b.railh && (b.railh.scrollable = !1)) : (b.page.maxw -= b.opt.railpadding.left + b.opt.railpadding.right, b.railh && (b.railh.scrollable = b.opt.horizrailenabled)), b.railslocked = b.locked || 0 == b.page.maxh && 0 == b.page.maxw, b.railslocked ? (b.ispage || b.updateScrollBar(b.view), !1) : (b.hidden || b.visibility ? !b.railh || b.hidden || b.railh.visibility || b.showRailHr() : b.showRail().showRailHr(), b.istextarea && b.win.css("resize") && "none" != b.win.css("resize") && (b.view.h -= 20), b.cursorheight = Math.min(b.view.h, Math.round(b.view.h * (b.view.h / b.page.h))), b.cursorheight = b.opt.cursorfixedheight ? b.opt.cursorfixedheight : Math.max(b.opt.cursorminheight, b.cursorheight), b.cursorwidth = Math.min(b.view.w, Math.round(b.view.w * (b.view.w / b.page.w))), b.cursorwidth = b.opt.cursorfixedheight ? b.opt.cursorfixedheight : Math.max(b.opt.cursorminheight, b.cursorwidth), b.scrollvaluemax = b.view.h - b.cursorheight - b.cursor.hborder - (b.opt.railpadding.top + b.opt.railpadding.bottom), b.railh && (b.railh.width = b.page.maxh > 0 ? b.view.w - b.rail.width : b.view.w, b.scrollvaluemaxw = b.railh.width - b.cursorwidth - b.cursorh.wborder - (b.opt.railpadding.left + b.opt.railpadding.right)), b.ispage || b.updateScrollBar(b.view), b.scrollratio = { 887 x: b.page.maxw / b.scrollvaluemaxw, 888 y: b.page.maxh / b.scrollvaluemax 889 }, b.getScrollTop() > b.page.maxh ? b.doScrollTop(b.page.maxh) : (b.scroll.y = Math.round(b.getScrollTop() * (1 / b.scrollratio.y)), b.scroll.x = Math.round(b.getScrollLeft() * (1 / b.scrollratio.x)), b.cursoractive && b.noticeCursor()), b.scroll.y && 0 == b.getScrollTop() && b.doScrollTo(Math.floor(b.scroll.y * b.scrollratio.y)), b) 890 }, this.resize = b.onResize, this.hlazyresize = 0, this.lazyResize = function (e) { 891 return b.haswrapper || b.hide(), b.hlazyresize && clearTimeout(b.hlazyresize), b.hlazyresize = setTimeout(function () { 892 b && (b.resize(), b.show()) 893 }, 240), b 894 }, this.jqbind = function (e, o, t) { 895 b.events.push({e: e, n: o, f: t, q: !0}), s(e).bind(o, t) 896 }, this.mousewheel = function (e, o, t) { 897 var r = "jquery" in e ? e[0] : e; 898 if ("onwheel" in document.createElement("div")) b._bind(r, "wheel", o, t || !1); else { 899 var i = void 0 !== document.onmousewheel ? "mousewheel" : "DOMMouseScroll"; 900 w(r, i, o, t || !1), "DOMMouseScroll" == i && w(r, "MozMousePixelScroll", o, t || !1) 901 } 902 }, z.haseventlistener) { 903 this.bind = function (e, o, t, r, i) { 904 var n = "jquery" in e ? e[0] : e; 905 b._bind(n, o, t, r || !1, i || !1) 906 }; 907 var L = !1;
908 try { 909 var C = Object.defineProperty({}, "passive", { 910 get: function () { 911 L = !0 912 } 913 }); 914 window.addEventListener("test", null, C) 915 } catch (e) { 916 } 917 this._bind = function (e, o, t, r, i) { 918 b.events.push({e: e, n: o, f: t, b: r, q: !1}), L && i ? e.addEventListener(o, t, { 919 passive: !1, 920 capture: r 921 }) : e.addEventListener(o, t, r || !1) 922 }, this.cancelEvent = function (e) { 923 return !!e && ((e = e.original ? e.original : e).cancelable && e.preventDefault(), e.stopPropagation(), e.preventManipulation && e.preventManipulation(), !1) 924 }, this.stopPropagation = function (e) { 925 return !!e && ((e = e.original ? e.original : e).stopPropagation(), !1) 926 }, this._unbind = function (e, o, t, r) { 927 e.removeEventListener(o, t, r) 928 } 929 } else this.bind = function (e, o, t, r) { 930 var i = "jquery" in e ? e[0] : e; 931 b._bind(i, o, function (e) { 932 return (e = e || window.event || !1) && e.srcElement && (e.target = e.srcElement), "pageY" in e || (e.pageX = e.clientX + document.documentElement.scrollLeft, e.pageY = e.clientY + document.documentElement.scrollTop), !1 !== t.call(i, e) && !1 !== r || b.cancelEvent(e) 933 }) 934 }, this._bind = function (e, o, t, r) { 935 b.events.push({e: e, n: o, f: t, b: r, q: !1}), e.attachEvent ? e.attachEvent("on" + o, t) : e["on" + o] = t 936 }, this.cancelEvent = function (e) { 937 return !!(e = window.event || !1) && (e.cancelBubble = !0, e.cancel = !0, e.returnValue = !1, !1) 938 }, this.stopPropagation = function (e) { 939 return !!(e = window.event || !1) && (e.cancelBubble = !0, !1) 940 }, this._unbind = function (e, o, t, r) { 941 e.detachEvent ? e.detachEvent("on" + o, t) : e["on" + o] = !1 942 }; 943 this.unbindAll = function () { 944 for (var e = 0; e < b.events.length; e++) { 945 var o = b.events[e]; 946 o.q ? o.e.unbind(o.n, o.f) : b._unbind(o.e, o.n, o.f, o.b) 947 } 948 }, this.showRail = function () { 949 return 0 == b.page.maxh || !b.ispage && "none" == b.win.css("display") || (b.visibility = !0, b.rail.visibility = !0, b.rail.css("display", "block")), b 950 }, this.showRailHr = function () { 951 return b.railh ? (0 == b.page.maxw || !b.ispage && "none" == b.win.css("display") || (b.railh.visibility = !0, b.railh.css("display", "block")), b) : b 952 }, this.hideRail = function () { 953 return b.visibility = !1, b.rail.visibility = !1, b.rail.css("display", "none"), b 954 }, this.hideRailHr = function () { 955 return b.railh ? (b.railh.visibility = !1, b.railh.css("display", "none"), b) : b 956 }, this.show = function () { 957 return b.hidden = !1, b.railslocked = !1, b.showRail().showRailHr() 958 }, this.hide = function () { 959 return b.hidden = !0, b.railslocked = !0, b.hideRail().hideRailHr() 960 }, this.toggle = function () { 961 return b.hidden ? b.show() : b.hide() 962 }, this.remove = function () { 963 b.stop(), b.cursortimeout && clearTimeout(b.cursortimeout); 964 for (var e in b.delaylist) b.delaylist[e] && a(b.delaylist[e].h); 965 b.doZoomOut(), b.unbindAll(), z.isie9 && b.win[0].detachEvent("onpropertychange", b.onAttributeChange), !1 !== b.observer && b.observer.disconnect(), !1 !== b.observerremover && b.observerremover.disconnect(), !1 !== b.observerbody && b.observerbody.disconnect(), b.events = null, b.cursor && b.cursor.remove(), b.cursorh && b.cursorh.remove(), b.rail && b.rail.remove(), b.railh && b.railh.remove(), b.zoom && b.zoom.remove(); 966 for (var o = 0; o < b.saved.css.length; o++) { 967 var t = b.saved.css[o]; 968 t[0].css(t[1], void 0 === t[2] ? "" : t[2]) 969 } 970 b.saved = !1, b.me.data("__nicescroll", ""); 971 var r = s.nicescroll; 972 r.each(function (e) { 973 if (this && this.id === b.id) { 974 delete r[e]; 975 for (var o = ++e; o < r.length; o++, e++) r[e] = r[o]; 976 --r.length && delete r[r.length] 977 } 978 }); 979 for (var i in b) b[i] = null, delete b[i]; 980 b = null 981 }, this.scrollstart = function (e) { 982 return this.onscrollstart = e, b 983 }, this.scrollend = function (e) { 984 return this.onscrollend = e, b 985 }, this.scrollcancel = function (e) { 986 return this.onscrollcancel = e, b 987 }, this.zoomin = function (e) { 988 return this.onzoomin = e, b 989 }, this.zoomout = function (e) { 990 return this.onzoomout = e, b 991 }, this.isScrollable = function (e) { 992 var o = e.target ? e.target : e; 993 if ("OPTION" == o.nodeName) return !0; 994 for (; o && 1 == o.nodeType && o !== this.me[0] && !/^BODY|HTML/.test(o.nodeName);) { 995 var t = s(o), r = t.css("overflowY") || t.css("overflowX") || t.css("overflow") || ""; 996 if (/scroll|auto/.test(r)) return o.clientHeight != o.scrollHeight; 997 o = !!o.parentNode && o.parentNode 998 } 999 return !1 1000 }, this.getViewport = function (e) { 1001 for (var o = !(!e || !e.parentNode) && e.parentNode; o && 1 == o.nodeType && !/^BODY|HTML/.test(o.nodeName);) { 1002 var t = s(o); 1003 if (/fixed|absolute/.test(t.css("position"))) return t; 1004 var r = t.css("overflowY") || t.css("overflowX") || t.css("overflow") || ""; 1005 if (/scroll|auto/.test(r) && o.clientHeight != o.scrollHeight) return t; 1006 if (t.getNiceScroll().length > 0) return t; 1007 o = !!o.parentNode && o.parentNode 1008 } 1009 return !1 1010 }, this.triggerScrollEnd = function () { 1011 if (b.onscrollend) { 1012 var e = b.getScrollLeft(), o = b.getScrollTop(), 1013 t = {type: "scrollend", current: {x: e, y: o}, end: {x: e, y: o}}; 1014 b.onscrollend.call(b, t) 1015 } 1016 }, this.onmousewheel = function (e) { 1017 if (!b.wheelprevented) { 1018 if (b.railslocked) return b.debounced("checkunlock", b.resize, 250), !0; 1019 if (b.rail.drag) return b.cancelEvent(e); 1020 if ("auto" == b.opt.oneaxismousemode && 0 != e.deltaX && (b.opt.oneaxismousemode = !1), b.opt.oneaxismousemode && 0 == e.deltaX && !b.rail.scrollable) return !b.railh || !b.railh.scrollable || b.onmousewheelhr(e); 1021 var o = +new Date, t = !1; 1022 if (b.opt.preservenativescrolling && b.checkarea + 600 < o && (b.nativescrollingarea = b.isScrollable(e), t = !0), b.checkarea = o, b.nativescrollingarea) return !0; 1023 var r = v(e, !1, t); 1024 return r && (b.checkarea = 0), r 1025 } 1026 }, this.onmousewheelhr = function (e) { 1027 if (!b.wheelprevented) { 1028 if (b.railslocked || !b.railh.scrollable) return !0; 1029 if (b.rail.drag) return b.cancelEvent(e); 1030 var o = +new Date, t = !1; 1031 return b.opt.preservenativescrolling && b.checkarea + 600 < o && (b.nativescrollingarea = b.isScrollable(e), t = !0), b.checkarea = o, !!b.nativescrollingarea || (b.railslocked ? b.cancelEvent(e) : v(e, !0, t)) 1032 } 1033 }, this.stop = function () { 1034 return b.cancelScroll(), b.scrollmon && b.scrollmon.stop(), b.cursorfreezed = !1, b.scroll.y = Math.round(b.getScrollTop() * (1 / b.scrollratio.y)), b.noticeCursor(), b 1035 }, this.getTransitionSpeed = function (e) { 1036 var o = Math.round(10 * b.opt.scrollspeed), t = Math.min(o, Math.round(e / 20 * b.opt.scrollspeed)); 1037 return t > 20 ? t : 0 1038 }, b.opt.smoothscroll ? b.ishwscroll && z.hastransition && b.opt.usetransition && b.opt.smoothscroll ? (this.prepareTransition = function (e, o) { 1039 var t = o ? e > 20 ? e : 0 : b.getTransitionSpeed(e), 1040 r = t ? z.prefixstyle + "transform " + t + "ms ease-out" : ""; 1041 return b.lasttransitionstyle && b.lasttransitionstyle == r || (b.lasttransitionstyle = r, b.doc.css(z.transitionstyle, r)), t 1042 }, this.doScrollLeft = function (e, o) { 1043 var t = b.scrollrunning ? b.newscrolly : b.getScrollTop(); 1044 b.doScrollPos(e, t, o) 1045 }, this.doScrollTop = function (e, o) { 1046 var t = b.scrollrunning ? b.newscrollx : b.getScrollLeft(); 1047 b.doScrollPos(t, e, o) 1048 }, this.doScrollPos = function (e, o, t) { 1049 var r = b.getScrollTop(), i = b.getScrollLeft(); 1050 return ((b.newscrolly - r) * (o - r) < 0 || (b.newscrollx - i) * (e - i) < 0) && b.cancelScroll(), 0 == b.opt.bouncescroll && (o < 0 ? o = 0 : o > b.page.maxh && (o = b.page.maxh), e < 0 ? e = 0 : e > b.page.maxw && (e = b.page.maxw)), (!b.scrollrunning || e != b.newscrollx || o != b.newscrolly) && (b.newscrolly = o, b.newscrollx = e, b.newscrollspeed = t || !1, !b.timer && void (b.timer = setTimeout(function () { 1051 var t = b.getScrollTop(), r = b.getScrollLeft(), i = {}; 1052 i.x = e - r, i.y = o - t, i.px = r, i.py = t; 1053 var n = Math.round(Math.sqrt(Math.pow(i.x, 2) + Math.pow(i.y, 2))), 1054 s = b.newscrollspeed && b.newscrollspeed > 1 ? b.newscrollspeed : b.getTransitionSpeed(n); 1055 if (b.newscrollspeed && b.newscrollspeed <= 1 && (s *= b.newscrollspeed), b.prepareTransition(s, !0), b.timerscroll && b.timerscroll.tm && clearInterval(b.timerscroll.tm), s > 0) { 1056 if (!b.scrollrunning && b.onscrollstart) { 1057 var l = { 1058 type: "scrollstart", 1059 current: {x: r, y: t}, 1060 request: {x: e, y: o}, 1061 end: {x: b.newscrollx, y: b.newscrolly}, 1062 speed: s 1063 }; 1064 b.onscrollstart.call(b, l) 1065 } 1066 z.transitionend ? b.scrollendtrapped || (b.scrollendtrapped = !0, b.bind(b.doc, z.transitionend, b.onScrollTransitionEnd, !1)) : (b.scrollendtrapped && clearTimeout(b.scrollendtrapped), b.scrollendtrapped = setTimeout(b.onScrollTransitionEnd, s)); 1067 var a = t, c = r; 1068 b.timerscroll = { 1069 bz: new k(a, b.newscrolly, s, 0, 0, .58, 1), 1070 bh: new k(c, b.newscrollx, s, 0, 0, .58, 1) 1071 }, b.cursorfreezed || (b.timerscroll.tm = setInterval(function () { 1072 b.showCursor(b.getScrollTop(), b.getScrollLeft()) 1073 }, 60)) 1074 } 1075 b.synched("doScroll-set", function () { 1076 b.timer = 0, b.scrollendtrapped && (b.scrollrunning = !0), b.setScrollTop(b.newscrolly), b.setScrollLeft(b.newscrollx), b.scrollendtrapped || b.onScrollTransitionEnd() 1077 }) 1078 }, 50))) 1079 }, this.cancelScroll = function () { 1080 if (!b.scrollendtrapped) return !0; 1081 var e = b.getScrollTop(), o = b.getScrollLeft(); 1082 return b.scrollrunning = !1, z.transitionend || clearTimeout(z.transitionend), b.scrollendtrapped = !1, b._unbind(b.doc[0], z.transitionend, b.onScrollTransitionEnd), b.prepareTransition(0), b.setScrollTop(e), b.railh && b.setScrollLeft(o), b.timerscroll && b.timerscroll.tm && clearInterval(b.timerscroll.tm), b.timerscroll = !1, b.cursorfreezed = !1, b.showCursor(e, o), b 1083 }, this.onScrollTransitionEnd = function () { 1084 b.scrollendtrapped && b._unbind(b.doc[0], z.transitionend, b.onScrollTransitionEnd), b.scrollendtrapped = !1, b.prepareTransition(0), b.timerscroll && b.timerscroll.tm && clearInterval(b.timerscroll.tm), b.timerscroll = !1; 1085 var e = b.getScrollTop(), o = b.getScrollLeft(); 1086 if (b.setScrollTop(e), b.railh && b.setScrollLeft(o), b.noticeCursor(!1, e, o), b.cursorfreezed = !1, e < 0 ? e = 0 : e > b.page.maxh && (e = b.page.maxh), o < 0 ? o = 0 : o > b.page.maxw && (o = b.page.maxw), e != b.newscrolly || o != b.newscrollx) return b.doScrollPos(o, e, b.opt.snapbackspeed); 1087 b.onscrollend && b.scrollrunning && b.triggerScrollEnd(), b.scrollrunning = !1 1088 }) : (this.doScrollLeft = function (e, o) { 1089 var t = b.scrollrunning ? b.newscrolly : b.getScrollTop(); 1090 b.doScrollPos(e, t, o) 1091 }, this.doScrollTop = function (e, o) { 1092 var t = b.scrollrunning ? b.newscrollx : b.getScrollLeft(); 1093 b.doScrollPos(t, e, o) 1094 }, this.doScrollPos = function (e, o, t) { 1095 function r() { 1096 if (b.cancelAnimationFrame) return !0; 1097 if (b.scrollrunning = !0, h = 1 - h) return b.timer = l(r) || 1; 1098 var e, o, t = 0, i = o = b.getScrollTop(); 1099 b.dst.ay ? (((s = (i = b.bzscroll ? b.dst.py + b.bzscroll.getNow() * b.dst.ay : b.newscrolly) - o) < 0 && i < b.newscrolly || s > 0 && i > b.newscrolly) && (i = b.newscrolly), b.setScrollTop(i), i == b.newscrolly && (t = 1)) : t = 1; 1100 var n = e = b.getScrollLeft(); 1101 if (b.dst.ax) { 1102 var s = (n = b.bzscroll ? b.dst.px + b.bzscroll.getNow() * b.dst.ax : b.newscrollx) - e; 1103 (s < 0 && n < b.newscrollx || s > 0 && n > b.newscrollx) && (n = b.newscrollx), b.setScrollLeft(n), n == b.newscrollx && (t += 1) 1104 } else t += 1; 1105 2 == t ? (b.timer = 0, b.cursorfreezed = !1, b.bzscroll = !1, b.scrollrunning = !1, i < 0 ? i = 0 : i > b.page.maxh && (i = Math.max(0, b.page.maxh)), n < 0 ? n = 0 : n > b.page.maxw && (n = b.page.maxw), n != b.newscrollx || i != b.newscrolly ? b.doScrollPos(n, i) : b.onscrollend && b.triggerScrollEnd()) : b.timer = l(r) || 1 1106 } 1107 1108 var o = void 0 === o || !1 === o ? b.getScrollTop(!0) : o; 1109 if (b.timer && b.newscrolly == o && b.newscrollx == e) return !0; 1110 b.timer && a(b.timer), b.timer = 0; 1111 var i = b.getScrollTop(), n = b.getScrollLeft(); 1112 ((b.newscrolly - i) * (o - i) < 0 || (b.newscrollx - n) * (e - n) < 0) && b.cancelScroll(), b.newscrolly = o, b.newscrollx = e, b.bouncescroll && b.rail.visibility || (b.newscrolly < 0 ? b.newscrolly = 0 : b.newscrolly > b.page.maxh && (b.newscrolly = b.page.maxh)), b.bouncescroll && b.railh.visibility || (b.newscrollx < 0 ? b.newscrollx = 0 : b.newscrollx > b.page.maxw && (b.newscrollx = b.page.maxw)), b.dst = {}
1112, b.dst.x = e - n, b.dst.y = o - i, b.dst.px = n, b.dst.py = i; 1113 var s = Math.round(Math.sqrt(Math.pow(b.dst.x, 2) + Math.pow(b.dst.y, 2))); 1114 b.dst.ax = b.dst.x / s, b.dst.ay = b.dst.y / s; 1115 var c = 0, d = s; 1116 0 == b.dst.x ? (c = i, d = o, b.dst.ay = 1, b.dst.py = 0) : 0 == b.dst.y && (c = n, d = e, b.dst.ax = 1, b.dst.px = 0); 1117 var u = b.getTransitionSpeed(s); 1118 if (t && t <= 1 && (u *= t), b.bzscroll = u > 0 && (b.bzscroll ? b.bzscroll.update(d, u) : new k(c, d, u, 0, 1, 0, 1)), !b.timer) { 1119 (i == b.page.maxh && o >= b.page.maxh || n == b.page.maxw && e >= b.page.maxw) && b.checkContentSize(); 1120 var h = 1; 1121 if (b.cancelAnimationFrame = !1, b.timer = 1, b.onscrollstart && !b.scrollrunning) { 1122 var p = { 1123 type: "scrollstart", 1124 current: {x: n, y: i}, 1125 request: {x: e, y: o}, 1126 end: {x: b.newscrollx, y: b.newscrolly}, 1127 speed: u 1128 }; 1129 b.onscrollstart.call(b, p) 1130 } 1131 r(), (i == b.page.maxh && o >= i || n == b.page.maxw && e >= n) && b.checkContentSize(), b.noticeCursor() 1132 } 1133 }, this.cancelScroll = function () { 1134 return b.timer && a(b.timer), b.timer = 0, b.bzscroll = !1, b.scrollrunning = !1, b 1135 }) : (this.doScrollLeft = function (e, o) { 1136 var t = b.getScrollTop(); 1137 b.doScrollPos(e, t, o) 1138 }, this.doScrollTop = function (e, o) { 1139 var t = b.getScrollLeft(); 1140 b.doScrollPos(t, e, o) 1141 }, this.doScrollPos = function (e, o, t) { 1142 var r = e > b.page.maxw ? b.page.maxw : e; 1143 r < 0 && (r = 0); 1144 var i = o > b.page.maxh ? b.page.maxh : o; 1145 i < 0 && (i = 0), b.synched("scroll", function () { 1146 b.setScrollTop(i), b.setScrollLeft(r) 1147 }) 1148 }, this.cancelScroll = function () { 1149 }), this.doScrollBy = function (e, o) { 1150 var t = 0; 1151 if (t = o ? Math.floor((b.scroll.y - e) * b.scrollratio.y) : (b.timer ? b.newscrolly : b.getScrollTop(!0)) - e, b.bouncescroll) { 1152 var r = Math.round(b.view.h / 2); 1153 t < -r ? t = -r : t > b.page.maxh + r && (t = b.page.maxh + r) 1154 } 1155 b.cursorfreezed = !1; 1156 var i = b.getScrollTop(!0); 1157 return t < 0 && i <= 0 ? b.noticeCursor() : t > b.page.maxh && i >= b.page.maxh ? (b.checkContentSize(), b.noticeCursor()) : void b.doScrollTop(t) 1158 }, this.doScrollLeftBy = function (e, o) { 1159 var t = 0; 1160 if (t = o ? Math.floor((b.scroll.x - e) * b.scrollratio.x) : (b.timer ? b.newscrollx : b.getScrollLeft(!0)) - e, b.bouncescroll) { 1161 var r = Math.round(b.view.w / 2); 1162 t < -r ? t = -r : t > b.page.maxw + r && (t = b.page.maxw + r) 1163 } 1164 b.cursorfreezed = !1; 1165 var i = b.getScrollLeft(!0); 1166 return t < 0 && i <= 0 ? b.noticeCursor() : t > b.page.maxw && i >= b.page.maxw ? b.noticeCursor() : void b.doScrollLeft(t) 1167 }, this.doScrollTo = function (e, o) { 1168 var t = o ? Math.round(e * b.scrollratio.y) : e; 1169 t < 0 ? t = 0 : t > b.page.maxh && (t = b.page.maxh), b.cursorfreezed = !1, b.doScrollTop(e) 1170 }, this.checkContentSize = function () { 1171 var e = b.getContentSize(); 1172 e.h == b.page.h && e.w == b.page.w || b.resize(!1, e) 1173 }, b.onscroll = function (e) { 1174 b.rail.drag || (b.cursorfreezed || b.synched("scroll", function () { 1175 b.scroll.y = Math.round(b.getScrollTop() * (1 / b.scrollratio.y)), b.railh && (b.scroll.x = Math.round(b.getScrollLeft() * (1 / b.scrollratio.x))), b.noticeCursor() 1176 }), b.triggerScrollEnd()) 1177 }, b.bind(b.docscroll, "scroll", b.onscroll), this.doZoomIn = function (e) { 1178 if (!b.zoomactive) { 1179 b.zoomactive = !0, b.zoomrestore = {style: {}}; 1180 var o = ["position", "top", "left", "zIndex", "backgroundColor", "marginTop", "marginBottom", "marginLeft", "marginRight"], 1181 t = b.win[0].style; 1182 for (var r in o) { 1183 var i = o[r]; 1184 b.zoomrestore.style[i] = void 0 !== t[i] ? t[i] : "" 1185 } 1186 b.zoomrestore.style.width = b.win.css("width"), b.zoomrestore.style.height = b.win.
vendor: 7,894 bytes, lines 1186-1340
1186css("height"), b.zoomrestore.padding = { 1187 w: b.win.outerWidth() - b.win.width(), 1188 h: b.win.outerHeight() - b.win.height() 1189 }, z.isios4 && (b.zoomrestore.scrollTop = s(window).scrollTop(), s(window).scrollTop(0)), b.win.css({ 1190 position: z.isios4 ? "absolute" : "fixed", 1191 top: 0, 1192 left: 0, 1193 zIndex: n + 100, 1194 margin: 0 1195 }); 1196 var l = b.win.css("backgroundColor"); 1197 return ("" == l || /transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(l)) && b.win.css("backgroundColor", "#fff"), b.rail.css({zIndex: n + 101}), b.zoom.css({zIndex: n + 102}), b.zoom.css("backgroundPosition", "0px -18px"), b.resizeZoom(), b.onzoomin && b.onzoomin.call(b), b.cancelEvent(e) 1198 } 1199 }, this.doZoomOut = function (e) { 1200 if (b.zoomactive) return b.zoomactive = !1, b.win.css("margin", ""), b.win.css(b.zoomrestore.style), z.isios4 && s(window).scrollTop(b.zoomrestore.scrollTop), b.rail.css({"z-index": b.zindex}), b.zoom.css({"z-index": b.zindex}), b.zoomrestore = !1, b.zoom.css("backgroundPosition", "0px 0px"), b.onResize(), b.onzoomout && b.onzoomout.call(b), b.cancelEvent(e) 1201 }, this.doZoom = function (e) { 1202 return b.zoomactive ? b.doZoomOut(e) : b.doZoomIn(e) 1203 }, this.resizeZoom = function () { 1204 if (b.zoomactive) { 1205 var e = b.getScrollTop(); 1206 b.win.css({ 1207 width: s(window).width() - b.zoomrestore.padding.w + "px", 1208 height: s(window).height() - b.zoomrestore.padding.h + "px" 1209 }), b.onResize(), b.setScrollTop(Math.min(b.page.maxh, e)) 1210 } 1211 }, this.init(), s.nicescroll.push(this) 1212 }, m = function (e) { 1213 var o = this; 1214 this.nc = e, this.lastx = 0, this.lasty = 0, this.speedx = 0, this.speedy = 0, this.lasttime = 0, this.steptime = 0, this.snapx = !1, this.snapy = !1, this.demulx = 0, this.demuly = 0, this.lastscrollx = -1, this.lastscrolly = -1, this.chkx = 0, this.chky = 0, this.timer = 0, this.time = function () { 1215 return +new Date 1216 }, this.reset = function (e, t) { 1217 o.stop(); 1218 var r = o.time(); 1219 o.steptime = 0, o.lasttime = r, o.speedx = 0, o.speedy = 0, o.lastx = e, o.lasty = t, o.lastscrollx = -1, o.lastscrolly = -1 1220 }, this.update = function (e, t) { 1221 var r = o.time(); 1222 o.steptime = r - o.lasttime, o.lasttime = r; 1223 var i = t - o.lasty, n = e - o.lastx, s = o.nc.getScrollTop() + i, l = o.nc.getScrollLeft() + n; 1224 o.snapx = l < 0 || l > o.nc.page.maxw, o.snapy = s < 0 || s > o.nc.page.maxh, o.speedx = n, o.speedy = i, o.lastx = e, o.lasty = t 1225 }, this.stop = function () { 1226 o.nc.unsynched("domomentum2d"), o.timer && clearTimeout(o.timer), o.timer = 0, o.lastscrollx = -1, o.lastscrolly = -1 1227 }, this.doSnapy = function (e, t) { 1228 var r = !1; 1229 t < 0 ? (t = 0, r = !0) : t > o.nc.page.maxh && (t = o.nc.page.maxh, r = !0), e < 0 ? (e = 0, r = !0) : e > o.nc.page.maxw && (e = o.nc.page.maxw, r = !0), r ? o.nc.doScrollPos(e, t, o.nc.opt.snapbackspeed) : o.nc.triggerScrollEnd() 1230 }, this.doMomentum = function (e) { 1231 var t = o.time(), r = e ? t + e : o.lasttime, i = o.nc.getScrollLeft(), n = o.nc.getScrollTop(), 1232 s = o.nc.page.maxh, l = o.nc.page.maxw; 1233 o.speedx = l > 0 ? Math.min(60, o.speedx) : 0, o.speedy = s > 0 ? Math.min(60, o.speedy) : 0; 1234 var a = r && t - r <= 60; 1235 (n < 0 || n > s || i < 0 || i > l) && (a = !1); 1236 var c = !(!o.speedy || !a) && o.speedy, d = !(!o.speedx || !a) && o.speedx; 1237 if (c || d) { 1238 var u = Math.max(16, o.steptime); 1239 if (u > 50) { 1240 var h = u / 50; 1241 o.speedx *= h, o.speedy *= h, u = 50 1242 } 1243 o.demulxy = 0, o.lastscrollx = o.nc.getScrollLeft(), o.chkx = o.lastscrollx, o.lastscrolly = o.nc.getScrollTop(), o.chky = o.lastscrolly; 1244 var p = o.lastscrollx, m = o.lastscrolly, f = function () { 1245 var e = o.time() - t > 600 ? .04 : .02; 1246 o.speedx && (p = Math.floor(o.lastscrollx - o.speedx * (1 - o.demulxy)), o.lastscrollx = p, (p < 0 || p > l) && (e = .1)), o.speedy && (m = Math.floor(o.lastscrolly - o.speedy * (1 - o.demulxy)), o.lastscrolly = m, (m < 0 || m > s) && (e = .1)), o.demulxy = Math.min(1, o.demulxy + e), o.nc.synched("domomentum2d", function () { 1247 if (o.speedx) { 1248 o.nc.getScrollLeft(); 1249 o.chkx = p, o.nc.setScrollLeft(p) 1250 } 1251 if (o.speedy) { 1252 o.nc.getScrollTop(); 1253 o.chky = m, o.nc.setScrollTop(m) 1254 } 1255 o.timer || (o.nc.hideCursor(), o.doSnapy(p, m)) 1256 }), o.demulxy < 1 ? o.timer = setTimeout(f, u) : (o.stop(), o.nc.hideCursor(), o.doSnapy(p, m)) 1257 }; 1258 f() 1259 } else o.doSnapy(o.nc.getScrollLeft(), o.nc.getScrollTop()) 1260 } 1261 }, f = e.fn.scrollTop; 1262 e.cssHooks.pageYOffset = { 1263 get: function (e, o, t) { 1264 var r = s.data(e, "__nicescroll") || !1; 1265 return r && r.ishwscroll ? r.getScrollTop() : f.call(e) 1266 }, set: function (e, o) { 1267 var t = s.data(e, "__nicescroll") || !1; 1268 return t && t.ishwscroll ? t.setScrollTop(parseInt(o)) : f.call(e, o), this 1269 } 1270 }, e.fn.scrollTop = function (e) { 1271 if (void 0 === e) { 1272 var o = !!this[0] && (s.data(this[0], "__nicescroll") || !1); 1273 return o && o.ishwscroll ? o.getScrollTop() : f.call(this) 1274 } 1275 return this.each(function () { 1276 var o = s.data(this, "__nicescroll") || !1; 1277 o && o.ishwscroll ? o.setScrollTop(parseInt(e)) : f.call(s(this), e) 1278 }) 1279 }; 1280 var g = e.fn.scrollLeft; 1281 s.cssHooks.pageXOffset = { 1282 get: function (e, o, t) { 1283 var r = s.data(e, "__nicescroll") || !1; 1284 return r && r.ishwscroll ? r.getScrollLeft() : g.call(e) 1285 }, set: function (e, o) { 1286 var t = s.data(e, "__nicescroll") || !1; 1287 return t && t.ishwscroll ? t.setScrollLeft(parseInt(o)) : g.call(e, o), this 1288 } 1289 }, e.fn.scrollLeft = function (e) { 1290 if (void 0 === e) { 1291 var o = !!this[0] && (s.data(this[0], "__nicescroll") || !1); 1292 return o && o.ishwscroll ? o.getScrollLeft() : g.call(this) 1293 } 1294 return this.each(function () { 1295 var o = s.data(this, "__nicescroll") || !1; 1296 o && o.ishwscroll ? o.setScrollLeft(parseInt(e)) : g.call(s(this), e) 1297 }) 1298 }; 1299 var w = function (e) { 1300 var o = this; 1301 if (this.length = 0, this.name = "nicescrollarray", this.each = function (e) { 1302 return s.each(o, e), o 1303 }, this.push = function (e) { 1304 o[o.length] = e, o.length++ 1305 }, this.eq = function (e) { 1306 return o[e] 1307 }, e) for (var t = 0; t < e.length; t++) { 1308 var r = s.data(e[t], "__nicescroll") || !1; 1309 r && (this[this.length] = r, this.length++) 1310 } 1311 return this 1312 }; 1313 !function (e, o, t) { 1314 for (var r = 0; r < o.length; r++) t(e, o[r]) 1315 }(w.prototype, ["show", "hide", "toggle", "onResize", "resize", "remove", "stop", "doScrollPos"], function (e, o) { 1316 e[o] = function () { 1317 var e = arguments; 1318 return this.each(function () { 1319 this[o].apply(this, e) 1320 }) 1321 } 1322 }), e.fn.getNiceScroll = function (e) { 1323 return void 0 === e ? new w(this) : this[e] && s.data(this[e], "__nicescroll") || !1 1324 }, e.expr[":"].nicescroll = function (e) { 1325 return void 0 !== s.data(e, "__nicescroll") 1326 }, s.fn.niceScroll = function (e, o) { 1327 void 0 !== o || "object" != typeof e || "jquery" in e || (o = e, e = !1), o = s.extend({}, o); 1328 var t = new w; 1329 void 0 === o && (o = {}), e && (o.doc = s(e), o.win = s(this)); 1330 var r = !("doc" in o); 1331 return r || "win" in o || (o.win = s(this)), this.each(function () { 1332 var e = s(this).data("__nicescroll") || !1; 1333 e || (o.doc = r ? s(this) : o.doc, e = new p(o, s(this)), s(this).data("__nicescroll", e)), t.push(e) 1334 }), 1 == t.length ? t[0] : t 1335 }, window.NiceScroll = { 1336 getjQuery: function () { 1337 return e 1338 } 1339 }, s.nicescroll || (s.nicescroll = new w, s.nicescroll.options = d) 1340});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.