]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Jun 2014 14:31:03 +0000 (14:31 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Jun 2014 14:31:03 +0000 (14:31 +0000)
js/main.js

index eda9baf9f0ea7a901cdbe9b07ebbe48cf4e77c57..252bec150d56d6f1d320e588163fd5389311c57c 100644 (file)
@@ -54,29 +54,32 @@ try {
        });
 
        function loadPhonegap() {
-               var cordova = 'data/cordova.js';
+               var cordovaPath = 'data/cordova.js';
                var cordovaStorage = window.localStorage.getItem('cordova');
                OFFLINEAPP = window.localStorage.getItem('offlineapp') == '1';
                if (window.localStorage.getItem('offline.' + DATAS.id) == '1') {
                        FINISHLOADING = true;
                }
 
-
                if (cordovaStorage) {
-                       cordova = window.localStorage.getItem('cordova');
+                       cordovaPath = window.localStorage.getItem('cordova');
                }
 
-
                document.addEventListener('deviceready', onDeviceReady, false);
                document.addEventListener("resume", onAppResume, false);
 
                loadJSLibrary(
-                               cordova
-                               , function() {
-                                       setTimeout(function() {
-                                               onDeviceReady();
-                                       }, 5000);
-                               });
+                               cordovaPath
+                               , cordovaLoaded);
+               if (window.cordova) {
+                       cordovaLoaded();
+               }
+       }
+
+       function cordovaLoaded() {
+               setTimeout(function() {
+                       onDeviceReady();
+               }, 5000);
        }
 
        function onDeviceOffline() {