mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 05:15:21 +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
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue