Some adjustments
This commit is contained in:
parent
de2acf34f7
commit
36a43c9ba9
@ -155,19 +155,6 @@ function initCordova() {
|
|||||||
// Handle back button to close things
|
// Handle back button to close things
|
||||||
document.addEventListener("backbutton", handleBackButton, false);
|
document.addEventListener("backbutton", handleBackButton, false);
|
||||||
document.addEventListener("deviceready", function () {
|
document.addEventListener("deviceready", function () {
|
||||||
if (getStorage("wakelock") == "true") {
|
|
||||||
window.powerManagement.acquire(function () {
|
|
||||||
console.log("Info", 'Wakelock acquired');
|
|
||||||
}, function () {
|
|
||||||
console.log("Warn", 'Failed to acquire wakelock');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
window.powerManagement.release(function () {
|
|
||||||
console.log("Info", 'Wakelock released');
|
|
||||||
}, function () {
|
|
||||||
console.log("Warn", 'Failed to release wakelock');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure the status bar color is set properly
|
// Make sure the status bar color is set properly
|
||||||
applyColorTheme();
|
applyColorTheme();
|
||||||
@ -175,6 +162,24 @@ function initCordova() {
|
|||||||
// start watching user position after everything's done, hopefully this will make it work
|
// start watching user position after everything's done, hopefully this will make it work
|
||||||
// with ios
|
// with ios
|
||||||
setupPositionWatcher();
|
setupPositionWatcher();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (getStorage("wakelock") == "true") {
|
||||||
|
window.powerManagement.acquire(function () {
|
||||||
|
console.log("Info", 'Wakelock acquired');
|
||||||
|
}, function () {
|
||||||
|
console.log("Warn", 'Failed to acquire wakelock');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
window.powerManagement.release(function () {
|
||||||
|
console.log("Info", 'Wakelock released');
|
||||||
|
}, function () {
|
||||||
|
console.log("Warn", 'Failed to release wakelock');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (ex) {
|
||||||
|
console.log("Warn", 'Failed to configure wakelock', ex);
|
||||||
|
}
|
||||||
}, false);
|
}, false);
|
||||||
openBrowser = function (url) {
|
openBrowser = function (url) {
|
||||||
cordova.InAppBrowser.open(url, '_blank', 'location=yes');
|
cordova.InAppBrowser.open(url, '_blank', 'location=yes');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user