tao-test/app/taoCe/views/js/loader/taoCe.min.js

2 lines
23 KiB
JavaScript
Raw Normal View History

2022-08-29 20:14:13 +02:00
function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}define("taoCe/controller/home/custom-scrollbar",["jquery"],function(jQuery){(function($){$.fn.customScrollbar=function(options,args){var _Mathmax=Math.max,defaultOptions={skin:void 0,hScroll:!0,vScroll:!0,updateOnWindowResize:!1,animationSpeed:300,onCustomScroll:void 0,swipeSpeed:1,wheelSpeed:40,fixedThumbWidth:void 0,fixedThumbHeight:void 0,preventDefaultScroll:!1},Scrollable=function(element,options){this.$element=$(element),this.options=options,this.addScrollableClass(),this.addSkinClass(),this.addScrollBarComponents(),this.options.vScroll&&(this.vScrollbar=new Scrollbar(this,new VSizing())),this.options.hScroll&&(this.hScrollbar=new Scrollbar(this,new HSizing())),this.$element.data("scrollable",this),this.initKeyboardScrolling(),this.bindEvents()};Scrollable.prototype={addScrollableClass:function addScrollableClass(){this.$element.hasClass("scrollable")||(this.scrollableAdded=!0,this.$element.addClass("scrollable"))},removeScrollableClass:function removeScrollableClass(){this.scrollableAdded&&this.$element.removeClass("scrollable")},addSkinClass:function addSkinClass(){"string"!=typeof this.options.skin||this.$element.hasClass(this.options.skin)||(this.skinClassAdded=!0,this.$element.addClass(this.options.skin))},removeSkinClass:function removeSkinClass(){this.skinClassAdded&&this.$element.removeClass(this.options.skin)},addScrollBarComponents:function addScrollBarComponents(){this.assignViewPort(),0==this.$viewPort.length&&(this.$element.wrapInner("<div class=\"viewport\" />"),this.assignViewPort(),this.viewPortAdded=!0),this.assignOverview(),0==this.$overview.length&&(this.$viewPort.wrapInner("<div class=\"overview\" />"),this.assignOverview(),this.overviewAdded=!0),this.addScrollBar("vertical","prepend"),this.addScrollBar("horizontal","append")},removeScrollbarComponents:function removeScrollbarComponents(){this.removeScrollbar("vertical"),this.removeScrollbar("horizontal"),this.overviewAdded&&this.$element.unwrap(),this.viewPortAdded&&this.$element.unwrap()},removeScrollbar:function removeScrollbar(orientation){this[orientation+"ScrollbarAdded"]&&this.$element.find(".scroll-bar."+orientation).remove()},assignViewPort:function assignViewPort(){this.$viewPort=this.$element.find(".viewport")},assignOverview:function assignOverview(){this.$overview=this.$viewPort.find(".overview")},addScrollBar:function addScrollBar(orientation,fun){0==this.$element.find(".scroll-bar."+orientation).length&&(this.$element[fun]("<div class='scroll-bar "+orientation+"'><div class='thumb'></div></div>"),this[orientation+"ScrollbarAdded"]=!0)},resize:function resize(keepPosition){this.vScrollbar&&this.vScrollbar.resize(keepPosition),this.hScrollbar&&this.hScrollbar.resize(keepPosition)},scrollTo:function scrollTo(element){this.vScrollbar&&this.vScrollbar.scrollToElement(element),this.hScrollbar&&this.hScrollbar.scrollToElement(element)},scrollToXY:function scrollToXY(x,y){this.scrollToX(x),this.scrollToY(y)},scrollToX:function scrollToX(x){this.hScrollbar&&this.hScrollbar.scrollOverviewTo(x,!0)},scrollToY:function scrollToY(y){this.vScrollbar&&this.vScrollbar.scrollOverviewTo(y,!0)},scrollByX:function scrollByX(x){this.hScrollbar&&this.scrollToX(this.hScrollbar.overviewPosition()+x)},scrollByY:function scrollByY(y){this.vScrollbar&&this.scrollToY(this.vScrollbar.overviewPosition()+y)},remove:function remove(){this.removeScrollableClass(),this.removeSkinClass(),this.removeScrollbarComponents(),this.$element.data("scrollable",null),this.removeKeyboardScrolling(),this.vScrollbar&&this.vScrollbar.remove(),this.hScrollbar&&this.hScrollbar.remove()},setAnimationSpeed:function setAnimationSpeed(speed){this.options.animationSpeed=speed},isInside:function isInside(element,wrappingElement){var $element=$(element),$wrappingElement=$(wrappingElement),elementOffse
//# sourceMappingURL=taoCe.min.js.map