This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
SXS20240115/SRC/iMES_PAD/JSplugins/angular-perfect-scrollbar/angular-perfect-scrollbar.min.js

2 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-01-24 16:47:50 +08:00
angular.module("perfect_scrollbar",[]).directive("perfectScrollbar",["$parse","$window",function(a,b){var c=["wheelSpeed","wheelPropagation","minScrollbarLength","maxScrollbarLength","useBothWheelAxes","useKeyboard","suppressScrollX","suppressScrollY","scrollXMarginOffset","scrollYMarginOffset","includePadding"],d={wheelPropagation:!0,suppressScrollX:!0,includePadding:!0,minScrollbarLength:10};return{restrict:"C",transclude:!0,template:'<div><div class="ps-scrollbar-content" ng-transclude></div></div>',replace:!0,link:function(e,f,g){function m(a){e.$evalAsync(function(){"true"==g.scrollDown&&"mouseenter"!=a&&setTimeout(function(){$(f).scrollTop($(f).prop("scrollHeight"))},100),f.perfectScrollbar("update")})}var h=angular.element(b),i=d;f=$(f[0]).css("overflow","hidden");for(var j=0,k=c.length;j<k;j++){var l=c[j];void 0!==g[l]&&(i[l]=a(g[l])())}e.$evalAsync(function(){f.perfectScrollbar(i);var b=a(g.onScroll);f.scroll(function(){var a=f.scrollTop(),c=f.prop("scrollHeight")-f.height();e.$apply(function(){b(e,{scrollTop:a,scrollHeight:c})})})}),f.bind("mouseenter",function(){m("mouseenter")}),g.refreshOnChange&&e.$watchCollection(g.refreshOnChange,function(){m()});var n=window.MutationObserver||window.WebKitMutationObserver,o={childList:!0,attributes:!0,characterData:!1},p=new n(function(){m()});p.observe(f.find("[ng-transclude]")[0],o),g.refreshOnResize&&h.on("resize",m),f.bind("$destroy",function(){h.off("resize",m),f.perfectScrollbar("destroy")})}}}]);