cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alsoro...@apache.org
Subject [5/6] cordova-plugin-splashscreen git commit: CB-11488 (browser) Guarding code against the case when deviceready fires earlier than the plugin init on cold-start
Date Tue, 11 Jul 2017 08:57:32 GMT
CB-11488 (browser) Guarding code against the case when deviceready fires earlier than the plugin
init on cold-start


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/b0e1157c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/b0e1157c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/b0e1157c

Branch: refs/heads/master
Commit: b0e1157c8add1427179f29a77c0fc0d609ede29a
Parents: a18cc82
Author: Peter (Somogyvari) Metz <peter.metz@unarin.com>
Authored: Fri Jul 1 23:01:14 2016 +0100
Committer: Alexander Sorokin <alexander.sorokin@akvelon.com>
Committed: Tue Jul 11 10:55:19 2017 +0300

----------------------------------------------------------------------
 src/browser/SplashScreenProxy.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/b0e1157c/src/browser/SplashScreenProxy.js
----------------------------------------------------------------------
diff --git a/src/browser/SplashScreenProxy.js b/src/browser/SplashScreenProxy.js
index 83c37d5..1a5cd30 100644
--- a/src/browser/SplashScreenProxy.js
+++ b/src/browser/SplashScreenProxy.js
@@ -77,6 +77,14 @@ var SplashScreen = {
 
             localSplash.appendChild(localSplashImage);
             document.body.appendChild(localSplash);
+
+            // deviceready fires earlier than the plugin init on cold-start
+            if (SplashScreen.shouldHideImmediately) {
+                SplashScreen.shouldHideImmediately = false;
+                window.setTimeout(function () {
+                    SplashScreen.hide();
+                }, 1000);
+            }
         }
     },
     hide: function () {
@@ -95,8 +103,8 @@ var SplashScreen = {
                 document.body.removeChild(innerLocalSplash);
                 innerLocalSplash = null;
             }, 1000);
-
-
+        } else {
+            SplashScreen.shouldHideImmediately = true;
         }
     }
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message