mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 21:35:33 +03:00
Cordova: add warning message when exiting the configurator
This commit is contained in:
parent
c59f49d160
commit
12d381998f
2 changed files with 19 additions and 0 deletions
|
@ -5832,5 +5832,11 @@
|
||||||
},
|
},
|
||||||
"cordovaWebviewUsed": {
|
"cordovaWebviewUsed": {
|
||||||
"message": "used"
|
"message": "used"
|
||||||
|
},
|
||||||
|
"cordovaExitAppTitle": {
|
||||||
|
"message": "Confirmation"
|
||||||
|
},
|
||||||
|
"cordovaExitAppMessage": {
|
||||||
|
"message": "Do you really want to close the configurator?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,19 @@ function startProcess() {
|
||||||
chrome.runtime.onSuspend.addListener(closeHandler);
|
chrome.runtime.onSuspend.addListener(closeHandler);
|
||||||
} else if (GUI.isCordova()) {
|
} else if (GUI.isCordova()) {
|
||||||
window.addEventListener('beforeunload', closeHandler);
|
window.addEventListener('beforeunload', closeHandler);
|
||||||
|
document.addEventListener('backbutton', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
navigator.notification.confirm(
|
||||||
|
i18n.getMessage('cordovaExitAppMessage'),
|
||||||
|
function(stat) {
|
||||||
|
if (stat === 1) {
|
||||||
|
navigator.app.exitApp();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
i18n.getMessage('cordovaExitAppTitle'),
|
||||||
|
[i18n.getMessage('yes'),i18n.getMessage('no')]
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.connect_b a.connect').removeClass('disabled');
|
$('.connect_b a.connect').removeClass('disabled');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue