@@ -6,15 +6,11 @@ import Adapter from './modules/adapter.js';
66
77angular . module ( 'ui.scroll' , [ ] )
88
9- . service ( 'uiScrollService' , function ( ) {
10- let instances = 0 ;
11- this . register = ( ) => instances ++ ;
12- this . count = ( ) => instances ;
13- } )
149 . constant ( 'JQLiteExtras' , JQLiteExtras )
15- . run ( [ 'JQLiteExtras' , ( JQLiteExtras ) =>
16- ! window . jQuery ? ( new JQLiteExtras ( ) ) . registerFor ( angular . element ) : null
17- ] )
10+ . run ( [ 'JQLiteExtras' , ( JQLiteExtras ) => {
11+ ! window . jQuery ? ( new JQLiteExtras ( ) ) . registerFor ( angular . element ) : null ;
12+ ElementRoutines . addCSSRules ( ) ;
13+ } ] )
1814
1915 . directive ( 'uiScrollViewport' , function ( ) {
2016 return {
@@ -47,8 +43,7 @@ angular.module('ui.scroll', [])
4743 '$interval' ,
4844 '$q' ,
4945 '$parse' ,
50- 'uiScrollService' ,
51- function ( console , $injector , $rootScope , $timeout , $interval , $q , $parse , uiScrollService ) {
46+ function ( console , $injector , $rootScope , $timeout , $interval , $q , $parse ) {
5247
5348 return {
5449 require : [ '?^uiScrollViewport' ] ,
@@ -65,8 +60,6 @@ angular.module('ui.scroll', [])
6560 throw new Error ( 'Expected uiScroll in form of \'_item_ in _datasource_\' but got \'' + $attr . uiScroll + '\'' ) ;
6661 }
6762
68- uiScrollService . register ( ) ;
69-
7063 function parseNumericAttr ( value , defaultValue ) {
7164 const result = $parse ( value ) ( $scope ) ;
7265 return isNaN ( result ) ? defaultValue : result ;
@@ -89,7 +82,7 @@ angular.module('ui.scroll', [])
8982 let ridActual = 0 ; // current data revision id
9083 let pending = [ ] ;
9184
92- const elementRoutines = new ElementRoutines ( $injector , $q , uiScrollService ) ;
85+ const elementRoutines = new ElementRoutines ( $injector , $q ) ;
9386 const buffer = new ScrollBuffer ( elementRoutines , bufferSize , startIndex ) ;
9487 const viewport = new Viewport ( elementRoutines , buffer , element , viewportController , $rootScope , padding ) ;
9588 const adapter = new Adapter ( $scope , $parse , $attr , viewport , buffer , doAdjust , reload ) ;
0 commit comments