Repository: cordova-windows Updated Branches: refs/heads/master e4e9573bd -> 623ff181d
CB-11751 'extendedSplashScreen' is undefined Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/623ff181 Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/623ff181 Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/623ff181 Branch: refs/heads/master Commit: 623ff181dbb780537c9a9b646db6f72bd59722e9 Parents: e4e9573 Author: daserge <[email protected]> Authored: Tue Nov 15 15:32:52 2016 +0300 Committer: daserge <[email protected]> Committed: Fri Dec 2 17:28:16 2016 +0300 ---------------------------------------------------------------------- cordova-js-src/splashscreen.js | 18 +++++++++++++----- template/www/cordova.js | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/623ff181/cordova-js-src/splashscreen.js ---------------------------------------------------------------------- diff --git a/cordova-js-src/splashscreen.js b/cordova-js-src/splashscreen.js index 786305d..4d35c63 100644 --- a/cordova-js-src/splashscreen.js +++ b/cordova-js-src/splashscreen.js @@ -210,7 +210,7 @@ function show() { positionControls(); // Once the extended splash screen is setup, apply the CSS style that will make the extended splash screen visible. - WinJS.Utilities.removeClass(extendedSplashScreen, 'hidden'); + WinJS.Utilities.removeClass(splashElement, 'hidden'); } function positionControls() { @@ -253,7 +253,7 @@ function updateImageLocation() { // Checks whether the extended splash screen is visible and returns a boolean. function isVisible() { - return !(WinJS.Utilities.hasClass(extendedSplashScreen, 'hidden')); + return !(WinJS.Utilities.hasClass(splashElement, 'hidden')); } function fadeOut(el, duration, finishCb) { @@ -273,13 +273,21 @@ function fadeOut(el, duration, finishCb) { function hide() { if (isVisible()) { var hideFinishCb = function () { - WinJS.Utilities.addClass(extendedSplashScreen, 'hidden'); - extendedSplashScreen.style.opacity = 1; + WinJS.Utilities.addClass(splashElement, 'hidden'); + splashElement.style.opacity = 1; enableUserInteraction(); } + // https://issues.apache.org/jira/browse/CB-11751 + // This can occur when we directly replace whole document.body f.e. in a router. + // Note that you should disable the splashscreen in this case or update a container element instead. + if (document.getElementById(splashElement.id) == null) { + hideFinishCb(); + return; + } + if (fadeSplashScreen) { - fadeOut(extendedSplashScreen, fadeSplashScreenDuration, hideFinishCb); + fadeOut(splashElement, fadeSplashScreenDuration, hideFinishCb); } else { hideFinishCb(); } http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/623ff181/template/www/cordova.js ---------------------------------------------------------------------- diff --git a/template/www/cordova.js b/template/www/cordova.js index fed8613..0f97f09 100644 --- a/template/www/cordova.js +++ b/template/www/cordova.js @@ -2066,7 +2066,7 @@ function show() { positionControls(); // Once the extended splash screen is setup, apply the CSS style that will make the extended splash screen visible. - WinJS.Utilities.removeClass(extendedSplashScreen, 'hidden'); + WinJS.Utilities.removeClass(splashElement, 'hidden'); } function positionControls() { @@ -2109,7 +2109,7 @@ function updateImageLocation() { // Checks whether the extended splash screen is visible and returns a boolean. function isVisible() { - return !(WinJS.Utilities.hasClass(extendedSplashScreen, 'hidden')); + return !(WinJS.Utilities.hasClass(splashElement, 'hidden')); } function fadeOut(el, duration, finishCb) { @@ -2129,13 +2129,21 @@ function fadeOut(el, duration, finishCb) { function hide() { if (isVisible()) { var hideFinishCb = function () { - WinJS.Utilities.addClass(extendedSplashScreen, 'hidden'); - extendedSplashScreen.style.opacity = 1; + WinJS.Utilities.addClass(splashElement, 'hidden'); + splashElement.style.opacity = 1; enableUserInteraction(); } + // https://issues.apache.org/jira/browse/CB-11751 + // This can occur when we directly replace whole document.body f.e. in a router. + // Note that you should disable the splashscreen in this case or update a container element instead. + if (document.getElementById(splashElement.id) == null) { + hideFinishCb(); + return; + } + if (fadeSplashScreen) { - fadeOut(extendedSplashScreen, fadeSplashScreenDuration, hideFinishCb); + fadeOut(splashElement, fadeSplashScreenDuration, hideFinishCb); } else { hideFinishCb(); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
