From ef5484a2aa72e63c2ad95d5533db6f25ed53e5c7 Mon Sep 17 00:00:00 2001 From: Raghav Katyal Date: Wed, 18 Nov 2015 11:34:45 -0800 Subject: [PATCH] CB-8940 Setting z-index values to maximum for UI buttons. This closes #140. --- src/windows/CameraProxy.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/windows/CameraProxy.js b/src/windows/CameraProxy.js index 64b6bb7..da8cf7d 100644 --- a/src/windows/CameraProxy.js +++ b/src/windows/CameraProxy.js @@ -73,6 +73,9 @@ var windowsPhoneVideoContainers = [".avi", ".3gp", ".3g2", ".wmv", ".3gp", ".3g // Default aspect ratio 1.78 (16:9 hd video standard) var DEFAULT_ASPECT_RATIO = '1.8'; +// Highest possible z-index supported across browsers. Anything used above is converted to this value. +var HIGHEST_POSSIBLE_Z_INDEX = 2147483647; + // Resize method function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { var tempPhotoFileName = ""; @@ -329,18 +332,18 @@ function takePictureFromCameraWP(successCallback, errorCallback, args) { // Create fullscreen preview // z-order style element for capturePreview and cameraCancelButton elts // is necessary to avoid overriding by another page elements, -1 sometimes is not enough - capturePreview = document.createElement("video"); - capturePreview.style.cssText = "position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 999;"; + capturePreview = document.createElement("video"); + capturePreview.style.cssText = "position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: " + (HIGHEST_POSSIBLE_Z_INDEX - 1) + ";"; // Create capture button cameraCaptureButton = document.createElement("button"); cameraCaptureButton.innerText = "Take"; - cameraCaptureButton.style.cssText = buttonStyle + "position: fixed; left: 0; bottom: 0; margin: 20px; z-index: 1000"; + cameraCaptureButton.style.cssText = buttonStyle + "position: fixed; left: 0; bottom: 0; margin: 20px; z-index: " + HIGHEST_POSSIBLE_Z_INDEX + ";"; // Create cancel button cameraCancelButton = document.createElement("button"); cameraCancelButton.innerText = "Cancel"; - cameraCancelButton.style.cssText = buttonStyle + "position: fixed; right: 0; bottom: 0; margin: 20px; z-index: 1000"; + cameraCancelButton.style.cssText = buttonStyle + "position: fixed; right: 0; bottom: 0; margin: 20px; z-index: " + HIGHEST_POSSIBLE_Z_INDEX + ";"; capture = new CaptureNS.MediaCapture();