Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #252 from daserge/css-fixes
Browse files Browse the repository at this point in the history
[Windows] CSS fixes - no-select, no-zoom, no-scroll
  • Loading branch information
Vladimir Kotikov committed Jun 6, 2016
2 parents b20c046 + 5364553 commit a3d4dfa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/windows/BarcodeScannerProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,16 @@ module.exports = {
});
}

function disableZoomAndScroll() {
document.body.classList.add('no-zoom');
document.body.classList.add('no-scroll');
}

function enableZoomAndScroll() {
document.body.classList.remove('no-zoom');
document.body.classList.remove('no-scroll');
}

/**
* Starts stream transmission to preview frame and then run barcode search
*/
Expand Down Expand Up @@ -394,6 +404,8 @@ module.exports = {
// Insert preview frame and controls into page
document.body.appendChild(capturePreviewFrame);

disableZoomAndScroll();

return setupFocus(captureSettings.capture.videoDeviceController.focusControl)
.then(function () {
Windows.Graphics.Display.DisplayInformation.getForCurrentView().addEventListener("orientationchanged", updatePreviewForRotation, false);
Expand Down Expand Up @@ -425,6 +437,8 @@ module.exports = {

capture && capture.stopRecordAsync();
capture = null;

enableZoomAndScroll();
}

/**
Expand Down
9 changes: 9 additions & 0 deletions src/windows/assets/plugin-barcodeScanner.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
width: 100%;
height: 100%;
z-index: 9999999;
-ms-user-select: none;
}

.barcode-scanner-preview {
Expand Down Expand Up @@ -72,3 +73,11 @@
.action-close:hover::before {
content: "\E0CA";
}

.no-zoom {
-ms-content-zooming: none;
}

.no-scroll {
overflow: hidden;
}

0 comments on commit a3d4dfa

Please sign in to comment.