diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-06-20 23:00:58 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-06-20 23:00:58 +0700 |
commit | f1d1fa4432c93627a461b3c538198888e10990e2 (patch) | |
tree | 51c8721abb37918a067cf1d7ddba1f80e50da40e | |
parent | 2132725af047e02248679f8ac5f2b625a01a1e72 (diff) |
[browser library] Fix error in strict mode.
-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 57ca5a24..1740eaed 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -196,6 +196,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; @@ -212,12 +218,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); |