1234567891011121314151617181920212223242526272829303132333435363738 |
- (function () {
- 'use strict';
- angular
- .module('angular-nicescroll', [])
- .directive('ngNicescroll', ngNicescroll);
- ngNicescroll.$inject = ['$rootScope'];
- /* @ngInject */
- function ngNicescroll($rootScope) {
- // Usage:
- //
- // Creates:
- //
- var directive = {
- link: link
- };
- return directive;
- function link(scope, element, attrs, controller) {
- var niceOption = scope.$eval(attrs.niceOption)
- var niceScroll = $(element).niceScroll(niceOption);
- niceScroll.onscrollend = function (data) {
- if (data.end.y >= this.page.maxh) {
- if (attrs.niceScrollEnd) scope.$evalAsync(attrs.niceScrollEnd);
- }
- };
- }
- }
- })();
|