You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2016/04/15 22:49:50 UTC
[04/11] cordova-plugin-statusbar git commit: CB-10683 Fix wrong
StatusBar.isVisible initial value on Windows
CB-10683 Fix wrong StatusBar.isVisible initial value on Windows
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/commit/bf7869ce
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/bf7869ce
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/bf7869ce
Branch: refs/heads/2.1.x
Commit: bf7869cec7a46e0a538c2e4d61ffa28ddba135cf
Parents: 8a3f9ed
Author: daserge <v-...@microsoft.com>
Authored: Wed Feb 24 10:32:46 2016 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Wed Feb 24 10:32:46 2016 +0300
----------------------------------------------------------------------
src/windows/StatusBarProxy.js | 6 ++++--
www/statusbar.js | 20 +++++++++++---------
2 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/bf7869ce/src/windows/StatusBarProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/StatusBarProxy.js b/src/windows/StatusBarProxy.js
index 1755fb7..3929ff0 100644
--- a/src/windows/StatusBarProxy.js
+++ b/src/windows/StatusBarProxy.js
@@ -55,9 +55,11 @@ function hexToRgb(hex) {
module.exports = {
_ready: function(win, fail) {
- win(statusBar.occludedRect.height !== 0);
+ if(isSupported()) {
+ var statusBar = getViewStatusBar();
+ win(statusBar.occludedRect.height !== 0);
+ }
},
-
overlaysWebView: function () {
// not supported
},
http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/bf7869ce/www/statusbar.js
----------------------------------------------------------------------
diff --git a/www/statusbar.js b/www/statusbar.js
index afef7dd..d9d0ea5 100644
--- a/www/statusbar.js
+++ b/www/statusbar.js
@@ -97,15 +97,17 @@ var StatusBar = {
};
-// prime it
-exec(function (res) {
- if (typeof res == 'object') {
- if (res.type == 'tap') {
- cordova.fireWindowEvent('statusTap');
+// prime it. setTimeout so that proxy gets time to init
+window.setTimeout(function () {
+ exec(function (res) {
+ if (typeof res == 'object') {
+ if (res.type == 'tap') {
+ cordova.fireWindowEvent('statusTap');
+ }
+ } else {
+ StatusBar.isVisible = res;
}
- } else {
- StatusBar.isVisible = res;
- }
-}, null, "StatusBar", "_ready", []);
+ }, null, "StatusBar", "_ready", []);
+}, 0);
module.exports = StatusBar;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org