diff --git a/app.js b/app.js index 7a15f0b..f7db14d 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,3 @@ -/*jshint es5:true */ /*global require:true, __dirname:true, console:true, process:true, setTimeout:true */ // Modules & Variables. diff --git a/config.js b/config.js index d491205..11b163c 100644 --- a/config.js +++ b/config.js @@ -74,12 +74,13 @@ config.getPublicDirectory = function () { }; config.getOptionsForLess = function() { + 'use strict'; var options = { compress: config.isDevelopment() ? false : true, cleancss: config.isDevelopment() ? false : true, report: config.isDevelopment() ? 'min' : 'gzip', optimization: config.isDevelopment() ? 1 : 5, - } + }; return options; }; diff --git a/src/js/src/app.js b/src/js/src/app.js index 75f7ba9..78fa261 100644 --- a/src/js/src/app.js +++ b/src/js/src/app.js @@ -325,9 +325,11 @@ var umobile = { **/ initialize: function () { 'use strict'; - // Listen to onDeviceReady event. - document.addEventListener('deviceready', umobile.onDeviceReady, false); - if (config.loginFn === 'mockLogin') { + // Check if uMobile is running on Cordova/Phonegap + if((window.cordova || window.PhoneGap || window.phonegap) && /^file:\/{3}[^\/]/i.test(window.location.href)) { + // Listen to onDeviceReady event. + document.addEventListener('deviceready', umobile.onDeviceReady, false); + } else { umobile.onDeviceReady(); } }