You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/01/28 02:00:57 UTC

[7/8] git commit: Proxy: Correct structure, and only ever create one splashscreen window.

Proxy: Correct structure, and only ever create one splashscreen window.


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/8dc057b7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/8dc057b7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/8dc057b7

Branch: refs/heads/master
Commit: 8dc057b796b34150de611314f27800da70df690a
Parents: 8aa0b24
Author: Gabriel Schulhof <ga...@intel.com>
Authored: Tue Nov 19 14:01:31 2013 +0200
Committer: Gabriel Schulhof <ga...@intel.com>
Committed: Tue Nov 19 14:01:56 2013 +0200

----------------------------------------------------------------------
 src/tizen/SplashScreenProxy.js | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/8dc057b7/src/tizen/SplashScreenProxy.js
----------------------------------------------------------------------
diff --git a/src/tizen/SplashScreenProxy.js b/src/tizen/SplashScreenProxy.js
index 3e90443..5222b6b 100644
--- a/src/tizen/SplashScreenProxy.js
+++ b/src/tizen/SplashScreenProxy.js
@@ -1,14 +1,16 @@
-var exec = require('cordova/exec');
+( function() {
 
-module.exports = {
-    splashscreen: {
-        win: null,
+win = null;
 
-        show: function() {
-            win= window.open('splashscreen.html');
-        },
+module.exports = {
+    show: function() {
+        if ( win === null ) {
+            win = window.open('splashscreen.html');
+        }
+    },
 
-        hide: function() {
+    hide: function() {
+        if ( win !== null ) {
             win.close();
             win = null;
         }
@@ -16,3 +18,5 @@ module.exports = {
 };
 
 require("cordova/tizen/commandProxy").add("SplashScreen", module.exports);
+
+})();