[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Fix infinite scroll

2017-08-24 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/373566 )

Change subject: Fix infinite scroll
..


Fix infinite scroll

Bug: T173807
Change-Id: I1c4be9438710cd0c7295ca8ea418c6f2352d468f
---
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/373566
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: master
Gerrit-Owner: Sbisson 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: Mooeypoo 
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[master]: Fix infinite scroll

2017-08-24 Thread Sbisson (Code Review)
Sbisson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373566 )

Change subject: Fix infinite scroll
..

Fix infinite scroll

Bug: T173807
Change-Id: I1c4be9438710cd0c7295ca8ea418c6f2352d468f
---
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/66/373566/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/373566
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: master
Gerrit-Owner: Sbisson 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits