aboutsummaryrefslogtreecommitdiff
path: root/src/library_browser.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-23 15:32:43 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-23 15:32:43 -0700
commit2ebcf95b0e305f777143e3ad783896c17b769324 (patch)
treee0a60a9c313bf4526bec8fe2029d341302caa2f9 /src/library_browser.js
parent8c6578568956816cbb518584cbfa1321587727a7 (diff)
parent3eb16db0edc678ca6183b3d0254b925aee575469 (diff)
Merge branch 'incoming' into proxyGL
Diffstat (limited to 'src/library_browser.js')
-rw-r--r--src/library_browser.js12
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);