fix(platform): Fix Platform.showStatusBar so it can be used multiple times, closes #702

This commit is contained in:
Adam Bradley
2014-02-28 23:31:13 -06:00
parent 0c5c675164
commit a6c47cd3bf

View File

@@ -64,7 +64,7 @@
if(this.isAndroid() && version < 4.4) {
this.grade = (version < 4 ? 'c' : 'b');
}
}
}
}
},
@@ -160,10 +160,10 @@
showStatusBar: function(val) {
// Only useful when run within cordova
this.showStatusBar = val;
this._showStatusBar = val;
this.ready(function(){
// run this only when or if the platform (cordova) is ready
if(ionic.Platform.showStatusBar) {
if(ionic.Platform._showStatusBar) {
// they do not want it to be full screen
StatusBar.show();
document.body.classList.remove('status-bar-hide');
@@ -203,7 +203,7 @@
// setup listeners to know when the device is ready to go
function onWindowLoad() {
if(ionic.Platform.isCordova()) {
// the window and scripts are fully loaded, and a cordova/phonegap
// the window and scripts are fully loaded, and a cordova/phonegap
// object exists then let's listen for the deviceready
document.addEventListener("deviceready", onPlatformReady, false);
} else {