mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-27 23:47:02 +01:00
1 line
42 KiB
JavaScript
1 line
42 KiB
JavaScript
|
(function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"undefined"!=typeof module&&module.exports?module.exports=n:n(jQuery,window,document)})(function(n){(function(u){var g="function"==typeof define&&define.amd,_="undefined"!=typeof module&&module.exports,S="https:"==document.location.protocol?"https:":"http:";g||(_?require("jquery-mousewheel")(n):n.event.special.mousewheel||n("head").append(decodeURI("%3Cscript src="+S+"//"+"cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"+"%3E%3C/script%3E"))),u()})(function(){var k,u="mCustomScrollbar",g="mCS",_=".mCustomScrollbar",S={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},v=0,C={},B=window.attachEvent&&!window.addEventListener?1:0,T=!1,O=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],D={init:function(ye){var ye=n.extend(!0,{},S,ye),Be=E.call(this);if(ye.live){var Te=ye.liveSelector||this.selector||_,ke=n(Te);if("off"===ye.live)return void I(Te);C[Te]=setTimeout(function(){ke.mCustomScrollbar(ye),"once"===ye.live&&ke.length&&I(Te)},500)}else I(Te);return ye.setWidth=ye.set_width?ye.set_width:ye.setWidth,ye.setHeight=ye.set_height?ye.set_height:ye.setHeight,ye.axis=ye.horizontalScroll?"x":R(ye.axis),ye.scrollInertia=0<ye.scrollInertia&&17>ye.scrollInertia?17:ye.scrollInertia,"object"!=typeof ye.mouseWheel&&!0==ye.mouseWheel&&(ye.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),ye.mouseWheel.scrollAmount=ye.mouseWheelPixels?ye.mouseWheelPixels:ye.mouseWheel.scrollAmount,ye.mouseWheel.normalizeDelta=ye.advanced.normalizeMouseWheelDelta?ye.advanced.normalizeMouseWheelDelta:ye.mouseWheel.normalizeDelta,ye.scrollButtons.scrollType=L(ye.scrollButtons.scrollType),W(ye),n(Be).each(function(){var Oe=n(this);if(!Oe.data(g)){Oe.data(g,{idx:++v,opt:ye,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:Oe.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var De=Oe.data(g),Ee=De.opt,We=Oe.data("mcs-axis"),Ie=Oe.data("mcs-scrollbar-position"),Re=Oe.data("mcs-theme");We&&(Ee.axis=We),Ie&&(Ee.scrollbarPosition=Ie),Re&&(Ee.theme=Re,W(Ee)),A.call(this),De&&Ee.callbacks.onCreate&&"function"==typeof Ee.callbacks.onCreate&&Ee.callbacks.onCreate.call(this),n("#mCSB_"+De.idx+"_container img:not(."+O[2]+")").addClass(O[2]),D.update.call(null,Oe)}})},update:function(ye,Be){var Te=ye||E.call(this);return n(Te).each(function(){var ke=n(this);if(ke.data(g)){var Oe=ke.data(g),De=Oe.opt,Ee=n("#mCSB_"+Oe.idx+"_container"),We=n("#mCSB_"+Oe.idx),Ie=[n("#mCSB_"+Oe.idx+"_dragger_vertical"),n("#mCSB_"+Oe.idx+"_dragger_horizontal")];if(!Ee.length)return;Oe.tweenRunning&&pe(ke),Be&&Oe&&De.callbacks.onBeforeUpdate&&"function"==typeof De.callbacks.onBeforeUpdate&&De.callbacks.onBeforeUpdate.call(this),ke.hasClass(O[3])&&ke.removeClass(O[3]),ke.hasClass(O[4])&&ke.removeClass(O[4]),We.css("max-height","none"),We.height()!==ke.height()&&We.css("max-height",ke.height()),P.call(this),"y"===De.axis||De.advanced.autoExpandHorizontalScroll||Ee.css("width",z(Ee)
|