Cordova: Close sheet modal when back button pressed
This commit is contained in:
parent
09b51d95f0
commit
403708572e
@ -113,7 +113,12 @@ function initCordova() {
|
|||||||
platform_type = "cordova";
|
platform_type = "cordova";
|
||||||
// Handle back button to close things
|
// Handle back button to close things
|
||||||
document.addEventListener("backbutton", function (event) {
|
document.addEventListener("backbutton", function (event) {
|
||||||
|
// Close map sheet if it's open
|
||||||
|
if ($(".sheet-modal").hasClass("modal-in")) {
|
||||||
|
app.sheet.close();
|
||||||
|
} else {
|
||||||
router.back({force: true, ignoreCache: true});
|
router.back({force: true, ignoreCache: true});
|
||||||
|
}
|
||||||
}, false);
|
}, false);
|
||||||
document.addEventListener("deviceready", function () {
|
document.addEventListener("deviceready", function () {
|
||||||
if (localStorage.getItem("wakelock") == "true") {
|
if (localStorage.getItem("wakelock") == "true") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user