Add check to only init and run JS code once - even if included multiple times.

This commit is contained in:
Bryce Curtis
2011-03-30 13:29:24 -05:00
parent b850d225f4
commit 908485751b
16 changed files with 139 additions and 59 deletions
+5 -1
View File
@@ -6,10 +6,13 @@
* Copyright (c) 2010-2011, IBM Corporation
*/
if (!PhoneGap.hasResource("app")) {
PhoneGap.addResource("app");
/**
* Constructor
*/
function App() {}
App = function() {};
/**
* Clear the resource cache.
@@ -87,3 +90,4 @@ App.prototype.exitApp = function() {
PhoneGap.addConstructor(function() {
navigator.app = window.app = new App();
});
};