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); + +})();