diff options
Diffstat (limited to 'src/library_html5.js')
-rw-r--r-- | src/library_html5.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/library_html5.js b/src/library_html5.js index 703f9a74..a38c2390 100644 --- a/src/library_html5.js +++ b/src/library_html5.js @@ -709,7 +709,9 @@ var LibraryJSEvents = { var eventHandler = { target: JSEvents.findEventTarget(target), - allowsDeferredCalls: true, + allowsDeferredCalls: false, // XXX Currently disabled, see bug https://bugzilla.mozilla.org/show_bug.cgi?id=966493 + // Once the above bug is resolved, enable the following condition if possible: + // allowsDeferredCalls: eventTypeString == 'touchstart', eventTypeString: eventTypeString, callbackfunc: callbackfunc, handlerFunc: handlerFunc, @@ -980,18 +982,23 @@ var LibraryJSEvents = { if (allowedOrientations & 2) orientations.push("portrait-secondary"); if (allowedOrientations & 4) orientations.push("landscape-primary"); if (allowedOrientations & 8) orientations.push("landscape-secondary"); + var succeeded; if (window.screen.lockOrientation) { - window.screen.lockOrientation(orientations); + succeeded = window.screen.lockOrientation(orientations); } else if (window.screen.mozLockOrientation) { - window.screen.mozLockOrientation(orientations); + succeeded = window.screen.mozLockOrientation(orientations); } else if (window.screen.webkitLockOrientation) { - window.screen.webkitLockOrientation(orientations); + succeeded = window.screen.webkitLockOrientation(orientations); } else if (window.screen.msLockOrientation) { - window.screen.msLockOrientation(orientations); + succeeded = window.screen.msLockOrientation(orientations); } else { return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}}; } - return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}}; + if (succeeded) { + return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}}; + } else { + return {{{ cDefine('EMSCRIPTEN_RESULT_FAILED') }}}; + } }, emscripten_unlock_orientation: function() { |