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
+4
View File
@@ -6,6 +6,9 @@
* Copyright (c) 2010, IBM Corporation
*/
if (!PhoneGap.hasResource("camera")) {
PhoneGap.addResource("camera");
/**
* This class provides access to the device camera.
*
@@ -91,3 +94,4 @@ PhoneGap.addConstructor(function() {
navigator.camera = new Camera();
}
});
};