Cordova: Close sheet modal when back button pressed

master
Skylar Ittner 4 years ago
parent 09b51d95f0
commit 403708572e

@ -113,7 +113,12 @@ function initCordova() {
platform_type = "cordova";
// Handle back button to close things
document.addEventListener("backbutton", function (event) {
router.back({force: true, ignoreCache: true});
// Close map sheet if it's open
if ($(".sheet-modal").hasClass("modal-in")) {
app.sheet.close();
} else {
router.back({force: true, ignoreCache: true});
}
}, false);
document.addEventListener("deviceready", function () {
if (localStorage.getItem("wakelock") == "true") {

Loading…
Cancel
Save