Fix canvas (screen) user select options to disable selection in Safari, Mozilla, etc. (#348)

This commit is contained in:
Sam El-Husseini 2018-02-26 13:58:51 -08:00 committed by GitHub
parent 54576ae77a
commit a2218d9ba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,6 +351,10 @@ namespace pxsim.visuals {
private buildScreenCanvas() {
this.screenCanvas = document.createElement("canvas");
this.screenCanvas.id = "board-screen-canvas";
this.screenCanvas.style.userSelect = "none";
this.screenCanvas.style.msUserSelect = "none";
this.screenCanvas.style.webkitUserSelect = "none";
(this.screenCanvas.style as any).MozUserSelect = "none";
this.screenCanvas.style.position = "absolute";
this.screenCanvas.addEventListener(pxsim.pointerEvents.up, ev => {
this.layoutView.selectBrick();