From 8dc057b796b34150de611314f27800da70df690a Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Tue, 19 Nov 2013 14:01:31 +0200 Subject: [PATCH] Proxy: Correct structure, and only ever create one splashscreen window. --- src/tizen/SplashScreenProxy.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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() { + +win = null; module.exports = { - splashscreen: { - win: null, + show: function() { + if ( win === null ) { + win = window.open('splashscreen.html'); + } + }, - show: function() { - 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); + +})();