diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-23 15:32:43 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-23 15:32:43 -0700 |
commit | 2ebcf95b0e305f777143e3ad783896c17b769324 (patch) | |
tree | e0a60a9c313bf4526bec8fe2029d341302caa2f9 /src/library_browser.js | |
parent | 8c6578568956816cbb518584cbfa1321587727a7 (diff) | |
parent | 3eb16db0edc678ca6183b3d0254b925aee575469 (diff) |
Merge branch 'incoming' into proxyGL
Diffstat (limited to 'src/library_browser.js')
-rw-r--r-- | src/library_browser.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index fff9387e..a3e68209 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -216,6 +216,12 @@ mergeInto(LibraryManager.library, { // Canvas event setup var canvas = Module['canvas']; + function pointerLockChange() { + Browser.pointerLock = document['pointerLockElement'] === canvas || + document['mozPointerLockElement'] === canvas || + document['webkitPointerLockElement'] === canvas || + document['msPointerLockElement'] === canvas; + } if (canvas) { // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module // Module['forcedAspectRatio'] = 4 / 3; @@ -232,12 +238,6 @@ mergeInto(LibraryManager.library, { function(){}; // no-op if function does not exist canvas.exitPointerLock = canvas.exitPointerLock.bind(document); - function pointerLockChange() { - Browser.pointerLock = document['pointerLockElement'] === canvas || - document['mozPointerLockElement'] === canvas || - document['webkitPointerLockElement'] === canvas || - document['msPointerLockElement'] === canvas; - } document.addEventListener('pointerlockchange', pointerLockChange, false); document.addEventListener('mozpointerlockchange', pointerLockChange, false); |