@@ -6,15 +6,11 @@ import Adapter from './modules/adapter.js';
6
6
7
7
angular . module ( 'ui.scroll' , [ ] )
8
8
9
- . service ( 'uiScrollService' , function ( ) {
10
- let instances = 0 ;
11
- this . register = ( ) => instances ++ ;
12
- this . count = ( ) => instances ;
13
- } )
14
9
. 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
+ } ] )
18
14
19
15
. directive ( 'uiScrollViewport' , function ( ) {
20
16
return {
@@ -47,8 +43,7 @@ angular.module('ui.scroll', [])
47
43
'$interval' ,
48
44
'$q' ,
49
45
'$parse' ,
50
- 'uiScrollService' ,
51
- function ( console , $injector , $rootScope , $timeout , $interval , $q , $parse , uiScrollService ) {
46
+ function ( console , $injector , $rootScope , $timeout , $interval , $q , $parse ) {
52
47
53
48
return {
54
49
require : [ '?^uiScrollViewport' ] ,
@@ -65,8 +60,6 @@ angular.module('ui.scroll', [])
65
60
throw new Error ( 'Expected uiScroll in form of \'_item_ in _datasource_\' but got \'' + $attr . uiScroll + '\'' ) ;
66
61
}
67
62
68
- uiScrollService . register ( ) ;
69
-
70
63
function parseNumericAttr ( value , defaultValue ) {
71
64
const result = $parse ( value ) ( $scope ) ;
72
65
return isNaN ( result ) ? defaultValue : result ;
@@ -89,7 +82,7 @@ angular.module('ui.scroll', [])
89
82
let ridActual = 0 ; // current data revision id
90
83
let pending = [ ] ;
91
84
92
- const elementRoutines = new ElementRoutines ( $injector , $q , uiScrollService ) ;
85
+ const elementRoutines = new ElementRoutines ( $injector , $q ) ;
93
86
const buffer = new ScrollBuffer ( elementRoutines , bufferSize , startIndex ) ;
94
87
const viewport = new Viewport ( elementRoutines , buffer , element , viewportController , $rootScope , padding ) ;
95
88
const adapter = new Adapter ( $scope , $parse , $attr , viewport , buffer , doAdjust , reload ) ;
0 commit comments