mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Add check to only init and run JS code once - even if included multiple times.
This commit is contained in:
@@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user