diff options
author | Thomas Tursics <thomas@tursics.de> | 2016-06-30 21:53:42 +0200 |
---|---|---|
committer | Thomas Tursics <thomas@tursics.de> | 2016-06-30 21:53:42 +0200 |
commit | aa694e3ca96cccebfe6c594a0ea15b997964fb64 (patch) | |
tree | c403a4a8c0c0c38aef821dc8196bd79b715c29a9 | |
parent | 620af54bf3322e41be51571f6c2ec9a6180dafd0 (diff) |
just to test in the browser: run without Cordova
-rw-r--r-- | www/js/app.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/www/js/app.js b/www/js/app.js index 3ca6542..3fa6e73 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -261,7 +261,9 @@ var tpl = { return this; } // Stop iOS scrolling the webview when it shows the keyboard - cordova.plugins.Keyboard.disableScroll(true); + if ( typeof cordova !== 'undefined' ) { + cordova.plugins.Keyboard.disableScroll(true); + } $('#load-screen').height( $(window).height() ); FMS.initialized = 1; if ( navigator && navigator.splashscreen ) { @@ -335,7 +337,11 @@ var tpl = { FMS.setupHelp(); Backbone.history.start(); - navigator.splashscreen.hide(); + if ( navigator && navigator.splashscreen ) { + navigator.splashscreen.hide(); + } else { + $('#load-screen').hide(); + } $('#display-help').show(); }); } @@ -368,6 +374,10 @@ var androidStartUp = function() { }; function onload() { - document.addEventListener('deviceready', FMS.initialize, false); - window.setTimeout( androidStartUp, 2000 ); + if( typeof cordova !== 'undefined' ) { + document.addEventListener('deviceready', FMS.initialize, false); + window.setTimeout( androidStartUp, 2000 ); + } else { + FMS.initialize(); + } } |