angular.module('perfect_scrollbar', []).directive('perfectScrollbar', ['$parse', '$window', function($parse, $window) { /** * wheelSpeed * wheelPropagation * minScrollbarLength * useBothWheelAxes * useKeyboard * suppressScrollX * suppressScrollY * scrollXMarginOffset * scrollYMarginOffset * includePadding */ var psOptions = [ 'wheelSpeed', 'wheelPropagation', 'minScrollbarLength', 'maxScrollbarLength', 'useBothWheelAxes', 'useKeyboard', 'suppressScrollX', 'suppressScrollY', 'scrollXMarginOffset', 'scrollYMarginOffset', 'includePadding'//, 'onScroll', 'scrollDown' ]; var default_options = { 'wheelPropagation':true, //If this option is true, when the scroll reaches the end of the side, mousewheel event will be propagated to parent element. 'suppressScrollX':true, //When set to true, the scroll bar in X axis will not be available, regardless of the content width. 'includePadding': true, 'minScrollbarLength':10 }; return { restrict: 'C', transclude: true, template: '
', replace: true, link: function($scope, $elem, $attr) { var jqWindow = angular.element($window); var options = default_options; $elem = $($elem[0]).css('overflow', 'hidden'); for (var i=0, l=psOptions.length; i