Large gap left in footer on pages with no related articles

An empty container was left on the page despite there being no related articles.
This should prevent adding the container on pages with no related articles.

Bug: T147217
Change-Id: I074a12e2d6680403551c436a4b00c3b9ab1c8d09
This commit is contained in:
divadsn 2016-12-10 12:03:32 +00:00 committed by Divadsn
parent db95760730
commit e9102f8d35

View file

@ -32,6 +32,8 @@
).done( function ( _, pages ) { ).done( function ( _, pages ) {
if ( pages.length ) { if ( pages.length ) {
mw.track( 'ext.relatedArticles.init', pages ); mw.track( 'ext.relatedArticles.init', pages );
} else {
readMore.remove();
} }
} ); } );
// detach handler to stop subsequent loads on scroll // detach handler to stop subsequent loads on scroll
@ -47,6 +49,7 @@
$( '<div class="read-more-container post-content" />' ) $( '<div class="read-more-container post-content" />' )
.insertAfter( '#content' ); .insertAfter( '#content' );
} }
// try related articles load on scroll // try related articles load on scroll
$window.on( 'scroll', debouncedLoad ); $window.on( 'scroll', debouncedLoad );
// try an initial load, in case of no scroll // try an initial load, in case of no scroll