@@ -33,7 +33,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
33
33
var adapter , adjustBuffer , adjustRowHeight , bof , bottomVisiblePos , buffer , bufferPadding , bufferSize , clipBottom , clipTop , datasource , datasourceName , enqueueFetch , eof , eventListener , fetch , finalize , first , insert , isDatasource , isLoading , itemName , loading , match , next , pending , reload , removeFromBuffer , resizeHandler , scrollHandler , scrollHeight , shouldLoadBottom , shouldLoadTop , tempScope , topVisiblePos , viewport ;
34
34
match = $attr . ngScroll . match ( / ^ \s * ( \w + ) \s + i n \s + ( \w + ) \s * $ / ) ;
35
35
if ( ! match ) {
36
- throw new Error ( " Expected ngScroll in form of '_item_ in _datasource_' but got '" + $attr . ngScroll + "'" ) ;
36
+ throw new Error ( ' Expected ngScroll in form of "item_ in _datasource_" but got "' + $attr . ngScroll + '"' ) ;
37
37
}
38
38
itemName = match [ 1 ] ;
39
39
datasourceName = match [ 2 ] ;
@@ -44,7 +44,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
44
44
if ( ! isDatasource ( datasource ) ) {
45
45
datasource = $injector . get ( datasourceName ) ;
46
46
if ( ! isDatasource ( datasource ) ) {
47
- throw new Error ( "" + datasourceName + " is not a valid datasource" ) ;
47
+ throw new Error ( datasourceName + ' is not a valid datasource' ) ;
48
48
}
49
49
}
50
50
bufferSize = Math . max ( 3 , + $attr . bufferSize || 10 ) ;
@@ -59,7 +59,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
59
59
var bottomPadding , createPadding , padding , repeaterType , topPadding , viewport ;
60
60
repeaterType = template [ 0 ] . localName ;
61
61
if ( repeaterType === 'dl' ) {
62
- throw new Error ( " ng-scroll directive does not support <" + template [ 0 ] . localName + " > as a repeating tag: " + template [ 0 ] . outerHTML ) ;
62
+ throw new Error ( ' ng-scroll directive does not support <' + template [ 0 ] . localName + ' > as a repeating tag: ' + template [ 0 ] . outerHTML ) ;
63
63
}
64
64
if ( repeaterType !== 'li' && repeaterType !== 'tr' ) {
65
65
repeaterType = 'div' ;
@@ -81,7 +81,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
81
81
} ;
82
82
return result ;
83
83
default :
84
- result = angular . element ( "<" + repeaterType + " ></" + repeaterType + ">" ) ;
84
+ result = angular . element ( '<' + repeaterType + ' ></' + repeaterType + '>' ) ;
85
85
result . paddingHeight = result . height ;
86
86
return result ;
87
87
}
@@ -175,7 +175,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
175
175
adapter . bottomPadding ( adapter . bottomPadding ( ) + bottomHeight ) ;
176
176
removeFromBuffer ( buffer . length - overage , buffer . length ) ;
177
177
next -= overage ;
178
- return console . log ( " clipped off bottom " + overage + " bottom padding " + ( adapter . bottomPadding ( ) ) ) ;
178
+ return console . log ( ' clipped off bottom ' + overage + ' bottom padding ' + ( adapter . bottomPadding ( ) ) ) ;
179
179
}
180
180
} ;
181
181
shouldLoadTop = function ( ) {
@@ -200,7 +200,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
200
200
adapter . topPadding ( adapter . topPadding ( ) + topHeight ) ;
201
201
removeFromBuffer ( 0 , overage ) ;
202
202
first += overage ;
203
- return console . log ( " clipped off top " + overage + " top padding " + ( adapter . topPadding ( ) ) ) ;
203
+ return console . log ( ' clipped off top ' + overage + ' top padding ' + ( adapter . topPadding ( ) ) ) ;
204
204
}
205
205
} ;
206
206
enqueueFetch = function ( direction , scrolling ) {
@@ -260,7 +260,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
260
260
adjustBuffer = function ( scrolling , newItems , finalize ) {
261
261
var doAdjustment ;
262
262
doAdjustment = function ( ) {
263
- console . log ( " top {actual=" + ( adapter . topDataPos ( ) ) + " visible from=" + ( topVisiblePos ( ) ) + " bottom {visible through=" + ( bottomVisiblePos ( ) ) + " actual=" + ( adapter . bottomDataPos ( ) ) + "}" ) ;
263
+ console . log ( ' top {actual=' + ( adapter . topDataPos ( ) ) + ' visible from=' + ( topVisiblePos ( ) ) + ' bottom {visible through=' + ( bottomVisiblePos ( ) ) + ' actual=' + ( adapter . bottomDataPos ( ) ) + '}' ) ;
264
264
if ( shouldLoadBottom ( ) ) {
265
265
enqueueFetch ( true , scrolling ) ;
266
266
} else {
@@ -309,14 +309,14 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
309
309
if ( result . length === 0 ) {
310
310
eof = true ;
311
311
adapter . bottomPadding ( 0 ) ;
312
- console . log ( " appended: requested " + bufferSize + " records starting from " + next + " recieved: eof" ) ;
312
+ console . log ( ' appended: requested ' + bufferSize + ' records starting from ' + next + ' recieved: eof' ) ;
313
313
} else {
314
314
clipTop ( ) ;
315
315
for ( _i = 0 , _len = result . length ; _i < _len ; _i ++ ) {
316
316
item = result [ _i ] ;
317
317
newItems . push ( insert ( ++ next , item ) ) ;
318
318
}
319
- console . log ( " appended: requested " + bufferSize + " received " + result . length + " buffer size " + buffer . length + " first " + first + " next " + next ) ;
319
+ console . log ( ' appended: requested ' + bufferSize + ' received ' + result . length + ' buffer size ' + buffer . length + ' first ' + first + ' next ' + next ) ;
320
320
}
321
321
return finalize ( scrolling , newItems ) ;
322
322
} ) ;
@@ -331,13 +331,13 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
331
331
if ( result . length === 0 ) {
332
332
bof = true ;
333
333
adapter . topPadding ( 0 ) ;
334
- console . log ( " prepended: requested " + bufferSize + " records starting from " + ( first - bufferSize ) + " recieved: bof" ) ;
334
+ console . log ( ' prepended: requested ' + bufferSize + ' records starting from ' + ( first - bufferSize ) + ' recieved: bof' ) ;
335
335
} else {
336
336
clipBottom ( ) ;
337
337
for ( i = _i = _ref = result . length - 1 ; _ref <= 0 ? _i <= 0 : _i >= 0 ; i = _ref <= 0 ? ++ _i : -- _i ) {
338
338
newItems . unshift ( insert ( -- first , result [ i ] ) ) ;
339
339
}
340
- console . log ( " prepended: requested " + bufferSize + " received " + result . length + " buffer size " + buffer . length + " first " + first + " next " + next ) ;
340
+ console . log ( ' prepended: requested ' + bufferSize + ' received ' + result . length + ' buffer size ' + buffer . length + ' first ' + first + ' next ' + next ) ;
341
341
}
342
342
return finalize ( scrolling , newItems ) ;
343
343
} ) ;
@@ -371,7 +371,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
371
371
viewport . unbind ( 'resize' , resizeHandler ) ;
372
372
return viewport . unbind ( 'scroll' , scrollHandler ) ;
373
373
} ) ;
374
- eventListener . $on ( " update.items" , function ( event , locator , newItem ) {
374
+ eventListener . $on ( ' update.items' , function ( event , locator , newItem ) {
375
375
var wrapper , _fn , _i , _len , _ref ;
376
376
if ( angular . isFunction ( locator ) ) {
377
377
_fn = function ( wrapper ) {
@@ -388,7 +388,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
388
388
}
389
389
return null ;
390
390
} ) ;
391
- eventListener . $on ( " delete.items" , function ( event , locator ) {
391
+ eventListener . $on ( ' delete.items' , function ( event , locator ) {
392
392
var i , item , temp , wrapper , _fn , _i , _j , _k , _len , _len1 , _len2 , _ref ;
393
393
if ( angular . isFunction ( locator ) ) {
394
394
temp = [ ] ;
@@ -418,7 +418,7 @@ angular.module('ui.scroll', []).directive('ngScrollViewport', [
418
418
}
419
419
return adjustBuffer ( false ) ;
420
420
} ) ;
421
- return eventListener . $on ( " insert.item" , function ( event , locator , item ) {
421
+ return eventListener . $on ( ' insert.item' , function ( event , locator , item ) {
422
422
var i , inserted , temp , wrapper , _fn , _i , _j , _k , _len , _len1 , _len2 , _ref ;
423
423
inserted = [ ] ;
424
424
if ( angular . isFunction ( locator ) ) {
0 commit comments