CB-11488 (browser) Guarding code against the case when deviceready fires earlier than the plugin init on cold-start
This commit is contained in:
parent
a18cc8241a
commit
b0e1157c8a
@ -77,6 +77,14 @@ var SplashScreen = {
|
|||||||
|
|
||||||
localSplash.appendChild(localSplashImage);
|
localSplash.appendChild(localSplashImage);
|
||||||
document.body.appendChild(localSplash);
|
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 () {
|
hide: function () {
|
||||||
@ -95,8 +103,8 @@ var SplashScreen = {
|
|||||||
document.body.removeChild(innerLocalSplash);
|
document.body.removeChild(innerLocalSplash);
|
||||||
innerLocalSplash = null;
|
innerLocalSplash = null;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
SplashScreen.shouldHideImmediately = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user