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

@ -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(){