scroller.js 2.2 KB
/**
 * Created by lgy on 2015/10/20.
 */

App.directive('scroller', function() {
  'use strict';

  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      element.slimScroll({
        height: $(window).height()-58,
        color: '#999',
        railVisible: true,
        railColor: '#ddd'
      });
    }
  };

}).directive('scrollerisediter', function() {
  'use strict';

  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      element.perfectScrollbar();
    }
  };

}).directive('scrollercrmlist', function() {
  'use strict';

  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      element.slimScroll({
        height: 245,
        color: '#999',
        railVisible: true,
        railColor: '#ddd'
      });
    }
  };

})
    .directive('scrolleraddrtypelist', function() {
      'use strict';
      //地址分组列表滚动
      return {
        restrict: 'A',
        link: function(scope, element, attrs) {
          element.slimScroll({
            height: $(window).height()-160,
            color: '#999',
            railVisible: true,
            railColor: '#ddd'
          });
        }
      };

    }).directive('scrollerplanlist', function() {
      'use strict';

      return {
        restrict: 'A',
        link: function(scope, element, attrs) {
          element.slimScroll({
            height: 220,
            color: '#999',
            railVisible: true,
            railColor: '#ddd'
          });
        }
      };
    }).directive('scrolleraddresslist', function() {
      'use strict';

      return {
        restrict: 'A',
        link: function(scope, element, attrs) {
          element.slimScroll({
            height: 400,
            color: '#999',
            railVisible: true,
            railColor: '#ddd'
          });
        }
      };
    }).directive('scrollerAll', function() {
      'use strict';

      return {
        restrict: 'AE',
        scope:{
          h:'=scrollerAll'
        },
        link: function(scope, element, attrs) {
          element.slimScroll({
            height: $(window).height()-scope.h-46,
            color: '#999',
            railVisible: true,
            railColor: '#ddd'
          });
        }
      };

    });