File tree Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change 552
552
var url = this . nextUrl ,
553
553
self = this ;
554
554
555
- this . pause ( ) ;
556
-
557
555
if ( ! url ) {
558
- this . fire ( 'noneLeft' , [ this . getLastItem ( ) ] ) ;
559
- this . listeners [ 'noneLeft' ] . disable ( ) ; // disable it so it only fires once
560
-
561
- self . resume ( ) ;
562
-
563
556
return false ;
564
557
}
565
558
559
+ this . pause ( ) ;
560
+
566
561
var promise = this . fire ( 'next' , [ url ] ) ;
567
562
568
563
promise . done ( function ( ) {
569
564
self . load ( url , function ( data , items ) {
570
565
self . render ( items , function ( ) {
571
566
self . nextUrl = self . getNextUrl ( data ) ;
572
567
568
+ if ( ! self . nextUrl ) {
569
+ self . fire ( 'noneLeft' , [ self . getLastItem ( ) ] ) ;
570
+ self . listeners [ 'noneLeft' ] . disable ( ) ; // disable it so it only fires once
571
+ }
572
+
573
573
self . resume ( ) ;
574
574
} ) ;
575
575
} ) ;
Original file line number Diff line number Diff line change @@ -179,16 +179,9 @@ describe("IAS", function () {
179
179
// scroll to page 3
180
180
scrollDown ( ) . then ( function ( ) {
181
181
wait ( 1500 ) . then ( function ( ) {
182
- expect ( spy1 ) . not . toHaveBeenCalled ( ) ;
182
+ expect ( spy1 ) . toHaveBeenCalledOnce ( ) ;
183
183
184
- // now on the final page, scroll down, and expect to have been called
185
- scrollDown ( ) . then ( function ( ) {
186
- wait ( 1500 ) . then ( function ( ) {
187
- expect ( spy1 ) . toHaveBeenCalledOnce ( ) ;
188
-
189
- deferred . resolve ( ) ;
190
- } ) ;
191
- } ) ;
184
+ deferred . resolve ( ) ;
192
185
} ) ;
193
186
} ) ;
194
187
} ) ;
You can’t perform that action at this time.
0 commit comments