Bmansurov has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/198132

Change subject: Show Overlays only after the DOM is ready
......................................................................

Show Overlays only after the DOM is ready

Bug: T88295
Change-Id: I7f0622084427fd58d648dce8bdb478645bd047c4
---
M javascripts/OverlayManager.js
1 file changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/32/198132/1

diff --git a/javascripts/OverlayManager.js b/javascripts/OverlayManager.js
index c04c19f..504976a 100644
--- a/javascripts/OverlayManager.js
+++ b/javascripts/OverlayManager.js
@@ -217,14 +217,18 @@
                 * which resolves to an overlay.
                 */
                add: function ( route, factory ) {
-                       var entry = {
-                               route: route,
-                               factory: factory
-                       };
+                       var self = this,
+                               entry = {
+                                       route: route,
+                                       factory: factory
+                               };
 
                        this.entries[route] = entry;
-                       // check if overlay should be shown for the current path
-                       this._processMatch( this._matchRoute( 
this.router.getPath(), entry ) );
+                       // Check if overlay should be shown for the current 
path.
+                       // The DOM must fully load before we can show the 
overlay because Overlay relies on it.
+                       $( function () {
+                               self._processMatch( self._matchRoute( 
self.router.getPath(), entry ) );
+                       } );
                },
 
                /**

-- 
To view, visit https://gerrit.wikimedia.org/r/198132
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f0622084427fd58d648dce8bdb478645bd047c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to