mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-24 08:14:21 +00:00
Hotfix: loadRelatedArticles should consider existence of container element
If undefined, the offset function will return undefined. Bug: T281547 Change-Id: I8ae3c1ee1d259c67d597a1891af029e6192008f8
This commit is contained in:
parent
edeb38fc58
commit
80ef6cffb4
|
@ -26,6 +26,11 @@
|
|||
var readMore = $( '.read-more-container' ).get( 0 ),
|
||||
scrollThreshold = $window.height() * 2;
|
||||
|
||||
if ( !readMore ) {
|
||||
// The container is not in the HTML for some reason and cannot be queried.
|
||||
// See T281547
|
||||
return;
|
||||
}
|
||||
if ( mw.viewport.isElementCloseToViewport( readMore, scrollThreshold ) ) {
|
||||
$.when(
|
||||
// Note we load dependencies here rather than ResourceLoader
|
||||
|
|
Loading…
Reference in a new issue