CB-9070. (ios) Fixed CameraPopoverHandle documentation

This closes #225
This commit is contained in:
Julio César 2016-07-31 18:06:39 +02:00
parent fed798e6c7
commit 4e439d85c3

View File

@ -94,9 +94,11 @@ Documentation consists of template and API docs produced from the plugin JS code
* [.PopoverArrowDirection](#module_Camera.PopoverArrowDirection) : <code>enum</code> * [.PopoverArrowDirection](#module_Camera.PopoverArrowDirection) : <code>enum</code>
* [.Direction](#module_Camera.Direction) : <code>enum</code> * [.Direction](#module_Camera.Direction) : <code>enum</code>
* [CameraPopoverHandle](#module_CameraPopoverHandle)
* [CameraPopoverOptions](#module_CameraPopoverOptions) * [CameraPopoverOptions](#module_CameraPopoverOptions)
* [CameraPopoverHandle](#module_CameraPopoverHandle)
* [.setPosition(options)](#module_CameraPopoverHandle.setPosition)
--- ---
<a name="module_camera"></a> <a name="module_camera"></a>
@ -116,10 +118,7 @@ Once the user snaps the photo, the camera application closes and the application
If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
`Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
that allows users to select an existing image. The that allows users to select an existing image.
`camera.getPicture` function returns a [`CameraPopoverHandle`](#module_CameraPopoverHandle) object,
which can be used to reposition the image selection dialog, for
example, when the device orientation changes.
The return value is sent to the [`cameraSuccess`](#module_camera.onSuccess) callback function, in The return value is sent to the [`cameraSuccess`](#module_camera.onSuccess) callback function, in
one of the following formats, depending on the specified one of the following formats, depending on the specified
@ -364,7 +363,17 @@ location.
<a name="module_CameraPopoverHandle"></a> <a name="module_CameraPopoverHandle"></a>
## CameraPopoverHandle ## CameraPopoverHandle
A handle to an image picker popover. A handle to the image picker popover.
<a name="module_CameraPopoverHandle.setPosition"></a>
### CameraPopoverHandle.setPosition(options)
Can be used to reposition the image selection dialog, for example, when the device orientation changes.
| Param | Type | Description |
| --- | --- | --- |
| options | <code>[CameraPopoverOptions](#module_CameraPopoverOptions)</code> | CameraPopoverOptions |
__Supported Platforms__ __Supported Platforms__
@ -372,7 +381,7 @@ __Supported Platforms__
**Example** **Example**
```js ```js
var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, navigator.camera.getPicture(onSuccess, onFail,
{ {
destinationType: Camera.DestinationType.FILE_URI, destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY, sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
@ -381,6 +390,7 @@ var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
// Reposition the popover if the orientation changes. // Reposition the popover if the orientation changes.
window.onorientationchange = function() { window.onorientationchange = function() {
var cameraPopoverHandle = new CameraPopoverHandle();
var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
cameraPopoverHandle.setPosition(cameraPopoverOptions); cameraPopoverHandle.setPosition(cameraPopoverOptions);
} }