Skip to content

Commit 156665f

Browse files
author
Nathan Koterba
committed
fix(infinite-scroll): Remove returns of adjustInfiniteScrollPosition.
Update uiGridInfiniteScrollService methods so they do not return promise of `adjustInfiniteScrollPosition` when `adjustInfiniteScrollPosition` does not itself return a promise. Also updated documentation to match code changes.
1 parent 5886ca7 commit 156665f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: src/features/infinite-scroll/js/infinite-scroll.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,11 @@
125125
* infinite scroll events upward
126126
* @param {boolean} scrollDown flag that there are pages downwards, so
127127
* fire infinite scroll events downward
128-
* @returns {promise} promise that is resolved when the scroll reset is complete
129128
*/
130129
resetScroll: function( scrollUp, scrollDown ) {
131130
service.setScrollDirections( grid, scrollUp, scrollDown);
132131

133-
return service.adjustInfiniteScrollPosition(grid, 0);
132+
service.adjustInfiniteScrollPosition(grid, 0);
134133
},
135134

136135

@@ -403,7 +402,6 @@
403402
* @description This function fires 'needLoadMoreData' or 'needLoadMoreDataTop' event based on scrollDirection
404403
* @param {Grid} grid the grid we're working on
405404
* @param {number} scrollTop the position through the grid that we want to scroll to
406-
* @returns {promise} a promise that is resolved when the scrolling finishes
407405
*/
408406
adjustInfiniteScrollPosition: function (grid, scrollTop) {
409407
var scrollEvent = new ScrollEvent(grid, null, null, 'ui.grid.adjustInfiniteScrollPosition'),
@@ -437,7 +435,6 @@
437435
* infinite scroll events upward
438436
* @param {boolean} scrollDown flag that there are pages downwards, so
439437
* fire infinite scroll events downward
440-
* @returns {promise} a promise that is resolved when the scrolling finishes
441438
*/
442439
dataRemovedTop: function( grid, scrollUp, scrollDown ) {
443440
var newVisibleRows, oldTop, newTop, rowHeight;
@@ -451,7 +448,7 @@
451448
// of rows removed
452449
newTop = oldTop - ( grid.infiniteScroll.previousVisibleRows - newVisibleRows )*rowHeight;
453450

454-
return service.adjustInfiniteScrollPosition( grid, newTop );
451+
service.adjustInfiniteScrollPosition( grid, newTop );
455452
},
456453

457454
/**
@@ -474,7 +471,7 @@
474471

475472
newTop = grid.infiniteScroll.prevScrollTop;
476473

477-
return service.adjustInfiniteScrollPosition( grid, newTop );
474+
service.adjustInfiniteScrollPosition( grid, newTop );
478475
}
479476
};
480477
return service;

0 commit comments

Comments
 (0)