From: Vincent Vanwaelscappel Date: Fri, 20 Jun 2014 17:27:51 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2265c5368091c0d029e06f6fdc35e72322819a93;p=fluidbook-html5.git --- diff --git a/js/main.js b/js/main.js index f6b72191..5537e801 100644 --- a/js/main.js +++ b/js/main.js @@ -13,6 +13,7 @@ var resolution = 'auto'; var OFFLINEAPP = false; var FINISHLOADING = false; var PLATFORM = 'web'; +var DEVICE_READY = false; try { $(function() { @@ -70,9 +71,13 @@ try { document.addEventListener("resume", onAppResume, false); + loadJSLibrary( cordova , function() { + setTimeout(function() { + onDeviceReady(); + }, 5000); }); } @@ -99,7 +104,11 @@ try { } function onDeviceReady() { + if (DEVICE_READY) { + return; + } + DEVICE_READY = true; document.addEventListener("offline", onDeviceOffline, false);