From 42b76c9e9364c418da5a968a19afe7ab96b9eb79 Mon Sep 17 00:00:00 2001 From: James Long Date: Fri, 19 Jul 2013 12:32:45 -0400 Subject: [PATCH] force landscape mode, other tweaks --- www/js/app.js | 15 ++++++++++++++- www/js/input.js | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index afcfdf1..dc714e0 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -158,7 +158,20 @@ define(function(require) { } function init() { - console.log(screen.mozLockOrientation('landscape-primary')); + screen.mozLockOrientation('landscape-primary'); + + // document.addEventListener('visibilitychange', function() { + // if(document.visibilityState == 'visible') { + // screen.mozLockOrientation('landscape-primary'); + // } + // }); + + document.addEventListener('mozfullscreenchange', function() { + if(document.mozFullScreenEnabled) { + screen.mozLockOrientation('landscape-primary'); + } + }); + renderer = new Renderer(); input.init(); diff --git a/www/js/input.js b/www/js/input.js index 139b4db..621e090 100644 --- a/www/js/input.js +++ b/www/js/input.js @@ -67,7 +67,7 @@ define(function(require) { var touch = e.changedTouches[0]; startPos = [touch.clientX, touch.clientY]; - dpad.style.backgroundColor = '#ccf'; + // dpad.style.backgroundColor = '#ccf'; } function dpadMove(e) { @@ -117,7 +117,7 @@ define(function(require) { pressedKeys['RIGHT'] = false; pressedKeys['DOWN'] = false; - dpad.style.backgroundColor = '#fcc'; + // dpad.style.backgroundColor = '#fcc'; } function init() {