Correct path for obtaining loadingOverlay

An undefined thing is not a constructor clearly
Introduced in 5593b23aa8

Bug: T216853
Change-Id: Ief5ca9098fc76a4ae8436dc6a3b4352e3c845147
This commit is contained in:
jdlrobson 2019-02-22 14:12:28 -08:00
parent b45120731f
commit 78ca1922f8
1 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
var
mobile = M.require( 'mobile.startup' ),
loader = mobile.rlModuleLoader,
LoadingOverlay = mobile.LoadingOverlay,
loadingOverlay = mobile.loadingOverlay,
eventBus = new EventEmitter(),
// eslint-disable-next-line jquery/no-global-selector
$talk = $( '.talk, [rel="discussion"]' ),
@ -84,13 +84,13 @@
if ( inTalkNamespace ) {
// reload the page after the new discussion was added
eventBus.on( 'talk-added-wo-overlay', function () {
var loadingOverlay = new LoadingOverlay();
var overlay = loadingOverlay();
window.location.hash = '';
// setTimeout to make sure, that loadingOverlay's overlayenabled class on html doesnt
// get removed by OverlayManager (who closes TalkSectionAddOverlay).
window.setTimeout( function () {
loadingOverlay.show();
overlay.show();
window.location.reload();
}, 10 );
} );