mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-30 19:14:49 +00:00
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:
parent
db95760730
commit
e9102f8d35
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue