From 06fcbf05a25a55316445d5b9ded58c8853a7d784 Mon Sep 17 00:00:00 2001 From: Raghav Katyal Date: Thu, 21 Jan 2016 14:11:59 -0800 Subject: [PATCH] Adding comments --- src/windows/CameraProxy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'); }); });