1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Merge pull request #2117 from WalcoFPV/cordova_app_exit_confirm

This commit is contained in:
Michael Keller 2020-07-12 14:01:07 +12:00 committed by GitHub
commit 525f18d4ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -187,6 +187,19 @@ function startProcess() {
chrome.runtime.onSuspend.addListener(closeHandler);
} else if (GUI.isCordova()) {
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');