You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ni...@apache.org on 2016/01/22 01:06:23 UTC
[1/2] cordova-plugin-camera git commit: Camera tapping fix
Repository: cordova-plugin-camera
Updated Branches:
refs/heads/master 6f7ce333c -> 06fcbf05a
Camera tapping fix
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/9a9081b0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/9a9081b0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/9a9081b0
Branch: refs/heads/master
Commit: 9a9081b0d4f1a49c7bf6fee6f0b1c273dfeedf76
Parents: 6f7ce33
Author: PerfectionCSGO <pe...@gmail.com>
Authored: Mon Dec 28 15:24:24 2015 +0100
Committer: Raghav Katyal <ra...@microsoft.com>
Committed: Thu Jan 21 14:07:51 2016 -0800
----------------------------------------------------------------------
src/windows/CameraProxy.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/9a9081b0/src/windows/CameraProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/CameraProxy.js b/src/windows/CameraProxy.js
index da8cf7d..e45ec9d 100644
--- a/src/windows/CameraProxy.js
+++ b/src/windows/CameraProxy.js
@@ -381,11 +381,16 @@ function takePictureFromCameraWP(successCallback, errorCallback, args) {
if (FocusControl.supported === true) {
capturePreview.addEventListener('click', function () {
-
+ // Make sure user can't click more than once
+ if (this.getAttribute('clicked') === '1') {
+ return false;
+ } else {
+ this.setAttribute('clicked', '1');
+ }
var preset = Windows.Media.Devices.FocusPreset.autoNormal;
-
+ var parent = this;
FocusControl.setPresetAsync(preset).done(function () {
-
+ parent.setAttribute('clicked', '0');
});
});
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] cordova-plugin-camera git commit: Adding comments
Posted by ni...@apache.org.
Adding comments
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/06fcbf05
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/06fcbf05
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/06fcbf05
Branch: refs/heads/master
Commit: 06fcbf05a25a55316445d5b9ded58c8853a7d784
Parents: 9a9081b
Author: Raghav Katyal <ra...@microsoft.com>
Authored: Thu Jan 21 14:11:59 2016 -0800
Committer: Raghav Katyal <ra...@microsoft.com>
Committed: Thu Jan 21 14:11:59 2016 -0800
----------------------------------------------------------------------
src/windows/CameraProxy.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/06fcbf05/src/windows/CameraProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/CameraProxy.js b/src/windows/CameraProxy.js
index e45ec9d..36e53d7 100644
--- a/src/windows/CameraProxy.js
+++ b/src/windows/CameraProxy.js
@@ -381,7 +381,7 @@ function takePictureFromCameraWP(successCallback, errorCallback, args) {
if (FocusControl.supported === true) {
capturePreview.addEventListener('click', function () {
- // Make sure user can't click more than once
+ // Make sure function isn't called again before previous focus is completed
if (this.getAttribute('clicked') === '1') {
return false;
} else {
@@ -390,6 +390,7 @@ function takePictureFromCameraWP(successCallback, errorCallback, args) {
var preset = Windows.Media.Devices.FocusPreset.autoNormal;
var parent = this;
FocusControl.setPresetAsync(preset).done(function () {
+ // set the clicked attribute back to '0' to allow focus again
parent.setAttribute('clicked', '0');
});
});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org