File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 10
10
</ head >
11
11
< body ng-controller ="mainController ">
12
12
13
- < h2 style ="position: fixed; left: 150px; top: 0; "> is loading: {{loading}}; < a href ="../index.html "> browse sample code</ a > </ h2 >
13
+ < h2 style ="position: fixed; left: 150px; top: 0; "> is loading: {{loading}}; < a href ="../index.html "> browse sample code</ a > < br /> counters: ab {{adapter.abCount}} abf {{adapter.abfCount}} s {{adapter.sCount}} < /h2 >
14
14
15
15
< div ui-scroll-viewport style ="width: 340px; height: 300px; display: block; background-color: white; ">
16
16
< ul >
17
- < li ui-scroll ="item in datasource " is-loading ="loading "> *{{item}}*</ li >
17
+ < li ui-scroll ="item in datasource " adapter =" adapter " is-loading ="loading "> *{{item}}*</ li >
18
18
</ ul >
19
19
</ div >
20
20
Original file line number Diff line number Diff line change @@ -610,6 +610,10 @@ angular.module('ui.scroll', [])
610
610
viewport . resetTopPaddingHeight ( ) ;
611
611
viewport . resetBottomPaddingHeight ( ) ;
612
612
613
+ adapter . abCount = 0 ;
614
+ adapter . abfCount = 0 ;
615
+ adapter . sCount = 0 ;
616
+
613
617
if ( arguments . length ) {
614
618
buffer . clear ( arguments [ 0 ] ) ;
615
619
} else {
@@ -725,6 +729,7 @@ angular.module('ui.scroll', [])
725
729
function adjustBuffer ( rid ) {
726
730
// We need the item bindings to be processed before we can do adjustment
727
731
return $timeout ( ( ) => {
732
+ adapter . abCount ++ ;
728
733
processBufferedItems ( rid ) ;
729
734
730
735
if ( viewport . shouldLoadBottom ( ) ) {
@@ -742,6 +747,7 @@ angular.module('ui.scroll', [])
742
747
function adjustBufferAfterFetch ( rid ) {
743
748
// We need the item bindings to be processed before we can do adjustment
744
749
return $timeout ( ( ) => {
750
+ adapter . abfCount ++ ;
745
751
let keepFetching = processBufferedItems ( rid ) ;
746
752
747
753
if ( viewport . shouldLoadBottom ( ) && keepFetching ) {
@@ -821,6 +827,7 @@ angular.module('ui.scroll', [])
821
827
822
828
function resizeAndScrollHandler ( ) {
823
829
if ( ! $rootScope . $$phase && ! adapter . isLoading ) {
830
+ adapter . sCount ++ ;
824
831
adjustBuffer ( ) ;
825
832
}
826
833
}
You can’t perform that action at this time.
0 commit comments