repo: janusweb
action: commit
revision: 
path_from: 
revision_from: b20488d3d59ec6940d624243897e7ed510a497ff:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit b20488d3d59ec6940d624243897e7ed510a497ff
Author: James Baicoianu 
Date:   Sat May 8 13:43:04 2021 -0700

    Exit pointerlock if still active when menu is shown

diff --git a/scripts/janusweb.js b/scripts/janusweb.js
index b225e36ab5f81928e3fc50829a56a8899403f51a..
index ..a00aebd404564a060db8459f6241021c844c2d52 100644
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -681,6 +681,9 @@ console.log('Register new SYSTEM tag type:', tagname, classobj, extendclass);
           overlay.hide();
         }
       }
+      if (document.pointerLockElement) {
+        document.exitPointerLock();
+      }
     }
     this.isVRActive = function() {
       return (typeof XRSession != 'undefined' && this.engine.client.xrsession instanceof XRSession);

-----END OF PAGE-----