aboutsummaryrefslogtreecommitdiff
path: root/src/library_glut.js
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-04-06 00:23:25 -0400
committerBehdad Esfahbod <behdad@behdad.org>2012-04-06 00:23:25 -0400
commit1b71441aff8597e92898ab52e2fab93559c70d16 (patch)
tree07f1df51483ee7dbacbb0cba0bf5e0c5f400a303 /src/library_glut.js
parent940d108b2ac9466e45fffcc5fd133523b58f0891 (diff)
Simplify
Diffstat (limited to 'src/library_glut.js')
-rw-r--r--src/library_glut.js45
1 files changed, 15 insertions, 30 deletions
diff --git a/src/library_glut.js b/src/library_glut.js
index b49073fb..4ab08d54 100644
--- a/src/library_glut.js
+++ b/src/library_glut.js
@@ -214,44 +214,29 @@ var LibraryGLUT = {
},
requestFullScreen: function() {
- var RFS = function() {};
- if (Module["canvas"]['requestFullscreen']) {
- RFS = Module["canvas"]['requestFullscreen'];
- } else if (Module["canvas"]['requestFullScreen']) {
- RFS = Module["canvas"]['requestFullScreen'];
- } else if (Module["canvas"]['mozRequestFullScreen']) {
- RFS = Module["canvas"]['mozRequestFullScreen'];
- } else if (Module["canvas"]['webkitRequestFullScreen']) {
- RFS = Module["canvas"]['webkitRequestFullScreen'];
- }
+ var RFS = Module["canvas"]['requestFullscreen'] ||
+ Module["canvas"]['requestFullScreen'] ||
+ Module["canvas"]['mozRequestFullScreen'] ||
+ Module["canvas"]['webkitRequestFullScreen'] ||
+ (function() {});
RFS.apply(Module["canvas"], []);
},
cancelFullScreen: function() {
- var CFS = function() {};
- if (document['exitFullscreen']) {
- CFS = document['exitFullscreen'];
- } else if (document['cancelFullScreen']) {
- CFS = document['cancelFullScreen'];
- } else if (document['mozCancelFullScreen']) {
- CFS = document['mozCancelFullScreen'];
- } else if (document['webkitCancelFullScreen']) {
- CFS = document['webkitCancelFullScreen'];
- }
+ var CFS = document['exitFullscreen'] ||
+ document['cancelFullScreen'] ||
+ document['mozCancelFullScreen'] ||
+ document['webkitCancelFullScreen'] ||
+ (function() {});
CFS.apply(document, []);
},
requestAnimationFrame: function(func) {
- var RAF = window['setTimeout'];
- if (window['requestAnimationFrame']) {
- RAF = window['requestAnimationFrame'];
- } else if (window['mozRequestAnimationFrame']) {
- RAF = window['mozRequestAnimationFrame'];
- } else if (window['webkitRequestAnimationFrame']) {
- RAF = window['webkitRequestAnimationFrame'];
- } else if (window['msRequestAnimationFrame']) {
- RAF = window['msRequestAnimationFrame'];
- }
+ var RAF = window['requestAnimationFrame'] ||
+ window['mozRequestAnimationFrame'] ||
+ window['webkitRequestAnimationFrame'] ||
+ window['msRequestAnimationFrame'] ||
+ window['setTimeout'];
RAF.apply(window, [func]);
},
},