Go to previous page when back button pressed
This commit is contained in:
parent
e8b416550d
commit
1e0b435064
@ -66,4 +66,6 @@ if (localStorage.getItem("darktheme") == "true") {
|
||||
$("#app").addClass("theme-dark");
|
||||
}
|
||||
|
||||
initPlatform();
|
||||
|
||||
router.navigate("/home");
|
@ -69,23 +69,11 @@ function initCordova() {
|
||||
|
||||
// Handle back button to close things
|
||||
document.addEventListener("backbutton", function (event) {
|
||||
router.back();
|
||||
router.back({force: true, ignoreCache: true});
|
||||
}, false);
|
||||
|
||||
document.addEventListener("deviceready", function () {
|
||||
app.statusbar.overlaysWebView(true);
|
||||
StatusBar.backgroundColorByHexString("#000000ff");
|
||||
if (cordova.platformId == 'android') {
|
||||
//StatusBar.backgroundColorByHexString("#324150");
|
||||
//StatusBar.styleLightContent();
|
||||
}
|
||||
router.on("routeChange", function (newRoute, previousRoute, router) {
|
||||
if (newRoute.name == "home") {
|
||||
StatusBar.styleDefault();
|
||||
} else {
|
||||
StatusBar.styleLightContent();
|
||||
}
|
||||
});
|
||||
|
||||
}, false);
|
||||
|
||||
openBrowser = function (url) {
|
||||
@ -110,21 +98,12 @@ function initCordova() {
|
||||
},
|
||||
{
|
||||
showTorchButton: true,
|
||||
prompt: "Find a code",
|
||||
prompt: "Scan barcode",
|
||||
resultDisplayDuration: 0,
|
||||
disableSuccessBeep: true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// When running on Android 8.0 (not 7.1.1, not 8.1, just 8.0), the statusbar
|
||||
// height is incorrectly set to 0px, causing the clock and icons to overlap
|
||||
// on the TerranQuest UI.
|
||||
document.addEventListener("deviceready", function () {
|
||||
if (device.platform == "Android" && device.version.startsWith("8.0") && getComputedStyle(document.documentElement).getPropertyValue('--f7-statusbar-height').startsWith("0")) {
|
||||
document.documentElement.style.setProperty('--f7-statusbar-height', '24px');
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
function initNW() {
|
||||
|
@ -10,6 +10,8 @@
|
||||
<link rel="stylesheet" href="node_modules/leaflet.locatecontrol/dist/L.Control.Locate.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/backdrop.css" />
|
||||
|
||||
<script src="cordova.js"></script>
|
||||
|
||||
<div id="app" class="color-theme-blue">
|
||||
|
||||
<div class="view view-main"></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user