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,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();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user