[MediaWiki-commits] [Gerrit] mediawiki...Flow[wmf/1.30.0-wmf.15]: Fix infinite scroll
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/373713 ) Change subject: Fix infinite scroll .. Fix infinite scroll Bug: T173807 Change-Id: I1c4be9438710cd0c7295ca8ea418c6f2352d468f (cherry picked from commit 7792033aa9cd9dc0376346bce6041844f0a0d295) --- M modules/engine/components/board/features/flow-board-loadmore.js 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/engine/components/board/features/flow-board-loadmore.js b/modules/engine/components/board/features/flow-board-loadmore.js index 900fc3e..32e6545 100644 --- a/modules/engine/components/board/features/flow-board-loadmore.js +++ b/modules/engine/components/board/features/flow-board-loadmore.js @@ -420,7 +420,7 @@ * @param {jQuery} $calculationContainer Container to do scroll calculations on (height, scrollTop, offset, etc.) */ function _flowBoardComponentLoadMoreFeatureInfiniteScrollCheck( $searchContainer, $calculationContainer ) { - var calculationContainerHeight, calculationContainerScroll, calculationContainerThreshold; + var calculationContainerHeight, calculationContainerScroll; if ( this.infiniteScrollDisabled ) { // This happens when the topic navigation is used to jump to a topic // We should not infinite-load anything when we are scrolling to a topic @@ -429,7 +429,6 @@ calculationContainerHeight = $calculationContainer.height(); calculationContainerScroll = $calculationContainer.scrollTop(); - calculationContainerThreshold = ( $calculationContainer.offset() || { top: calculationContainerScroll } ).top; // Find load more buttons within our search container, and they must be visible $searchContainer.find( this.$loadMoreNodes ).filter( ':visible' ).each( function () { @@ -438,7 +437,7 @@ nodeHeight = $this.outerHeight( true ); // First, is this element above or below us? - if ( nodeOffset <= calculationContainerThreshold ) { + if ( nodeOffset <= calculationContainerScroll ) { // Top of element is above the viewport; don't use it. return; } @@ -447,7 +446,7 @@ // also shouldn't be triggered if it's still behind TOC! // Is this element in the viewport? - if ( nodeOffset - nodeHeight <= calculationContainerThreshold + calculationContainerHeight ) { + if ( nodeOffset - nodeHeight <= calculationContainerScroll + calculationContainerHeight ) { // Element is almost in viewport, click it. $( this ).trigger( 'click' ); } -- To view, visit https://gerrit.wikimedia.org/r/373713 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c4be9438710cd0c7295ca8ea418c6f2352d468f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: wmf/1.30.0-wmf.15 Gerrit-Owner: Mattflaschen Gerrit-Reviewer: Mattflaschen Gerrit-Reviewer: Sbisson Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Flow[wmf/1.30.0-wmf.15]: Fix infinite scroll
Mattflaschen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373713 ) Change subject: Fix infinite scroll .. Fix infinite scroll Bug: T173807 Change-Id: I1c4be9438710cd0c7295ca8ea418c6f2352d468f (cherry picked from commit 7792033aa9cd9dc0376346bce6041844f0a0d295) --- M modules/engine/components/board/features/flow-board-loadmore.js 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/13/373713/1 diff --git a/modules/engine/components/board/features/flow-board-loadmore.js b/modules/engine/components/board/features/flow-board-loadmore.js index 900fc3e..32e6545 100644 --- a/modules/engine/components/board/features/flow-board-loadmore.js +++ b/modules/engine/components/board/features/flow-board-loadmore.js @@ -420,7 +420,7 @@ * @param {jQuery} $calculationContainer Container to do scroll calculations on (height, scrollTop, offset, etc.) */ function _flowBoardComponentLoadMoreFeatureInfiniteScrollCheck( $searchContainer, $calculationContainer ) { - var calculationContainerHeight, calculationContainerScroll, calculationContainerThreshold; + var calculationContainerHeight, calculationContainerScroll; if ( this.infiniteScrollDisabled ) { // This happens when the topic navigation is used to jump to a topic // We should not infinite-load anything when we are scrolling to a topic @@ -429,7 +429,6 @@ calculationContainerHeight = $calculationContainer.height(); calculationContainerScroll = $calculationContainer.scrollTop(); - calculationContainerThreshold = ( $calculationContainer.offset() || { top: calculationContainerScroll } ).top; // Find load more buttons within our search container, and they must be visible $searchContainer.find( this.$loadMoreNodes ).filter( ':visible' ).each( function () { @@ -438,7 +437,7 @@ nodeHeight = $this.outerHeight( true ); // First, is this element above or below us? - if ( nodeOffset <= calculationContainerThreshold ) { + if ( nodeOffset <= calculationContainerScroll ) { // Top of element is above the viewport; don't use it. return; } @@ -447,7 +446,7 @@ // also shouldn't be triggered if it's still behind TOC! // Is this element in the viewport? - if ( nodeOffset - nodeHeight <= calculationContainerThreshold + calculationContainerHeight ) { + if ( nodeOffset - nodeHeight <= calculationContainerScroll + calculationContainerHeight ) { // Element is almost in viewport, click it. $( this ).trigger( 'click' ); } -- To view, visit https://gerrit.wikimedia.org/r/373713 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c4be9438710cd0c7295ca8ea418c6f2352d468f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: wmf/1.30.0-wmf.15 Gerrit-Owner: Mattflaschen Gerrit-Reviewer: Sbisson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits