mobile: attempt to prevent sleep (issue #79)

This commit is contained in:
bordun 2017-09-14 20:37:17 +02:00
parent 8f9a0ea24f
commit c2bae64593
2 changed files with 12 additions and 0 deletions

View file

@ -16,6 +16,7 @@
"mathjs": "3.16.3",
"node-sass": "^4.5.3",
"nodemon": "^1.12.0",
"nosleep.js": "^0.7.0",
"screenfull": "^3.3.1",
"shortid": "2.2.8",
"socket.io-client": "2.0.3",

View file

@ -66,6 +66,17 @@ var callbacks = require('./app/callbacks'),
osc.init()
///////////////////////
var NoSleep = require('nosleep.js'),
noSleep = new NoSleep();
function enableNoSleep() {
noSleep.enable();
document.removeEventListener('touchstart', enableNoSleep, false);
}
document.addEventListener('touchstart', enableNoSleep, false);
///////////////////////
$(document).ready(function(){