mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 16:55:24 +03:00
Merge pull request #641 from basdelfos/confirm-reset
Added confirmation dialog for reset settings
This commit is contained in:
commit
0c628a985f
4 changed files with 87 additions and 9 deletions
|
@ -2635,14 +2635,17 @@
|
|||
},
|
||||
"onboardLoggingOnboardSDCard": {
|
||||
"message": "Onboard SD card"
|
||||
},
|
||||
"dialogConfirmResetTitle": {
|
||||
"message": "Confirm"
|
||||
},
|
||||
"dialogConfirmResetNote": {
|
||||
"message": "WARNING: Are you sure you want to reset ALL settings to default?"
|
||||
},
|
||||
"dialogConfirmResetConfirm": {
|
||||
"message": "Reset"
|
||||
},
|
||||
"dialogConfirmResetClose": {
|
||||
"message": "Cancel"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -257,3 +257,55 @@
|
|||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.tab-setup .regular-button {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 8px;
|
||||
margin-right: 10px;
|
||||
background-color: #ffbb00;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #dba718;
|
||||
color: #000;
|
||||
font-family: 'open_sansbold', Arial;
|
||||
font-size: 12px;
|
||||
text-shadow: 0px 1px rgba(255, 255, 255, 0.25);
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
transition: all ease 0.2s;
|
||||
padding: 0px;
|
||||
padding-left: 9px;
|
||||
padding-right: 9px;
|
||||
line-height: 28px;
|
||||
}
|
||||
.tab-setup .regular-button:hover {
|
||||
background-color: #ffcc3e;
|
||||
transition: all ease 0.2s;
|
||||
}
|
||||
.tab-setup .regular-button:active {
|
||||
background-color: #ffcc3e;
|
||||
transition: all ease 0.0s;
|
||||
box-shadow: inset 0px 1px 5px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
.tab-setup .regular-button.disabled {
|
||||
cursor: default;
|
||||
color: #fff;
|
||||
background-color: #AFAFAF;
|
||||
border: 1px solid #AFAFAF;
|
||||
pointer-events: none;
|
||||
text-shadow: none;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.tab-setup dialog {
|
||||
width: 40em;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.tab-setup dialog .buttons {
|
||||
position: static;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.tab-setup dialog h3 {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
|
@ -159,4 +159,16 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<dialog class="dialogConfirmReset">
|
||||
<h3 i18n="dialogConfirmResetTitle"></h3>
|
||||
<div class="content">
|
||||
<div i18n="dialogConfirmResetNote" style="margin-top: 10px"></div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<a href="#" class="dialogConfirmReset-confirmbtn regular-button" i18n="dialogConfirmResetConfirm"></a>
|
||||
<a href="#" class="dialogConfirmReset-cancelbtn regular-button" i18n="dialogConfirmResetClose"></a>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -107,7 +107,18 @@ TABS.setup.initialize = function (callback) {
|
|||
}
|
||||
});
|
||||
|
||||
var dialogConfirmReset = $('.dialogConfirmReset')[0];
|
||||
|
||||
$('a.resetSettings').click(function () {
|
||||
dialogConfirmReset.showModal();
|
||||
});
|
||||
|
||||
$('.dialogConfirmReset-cancelbtn').click(function() {
|
||||
dialogConfirmReset.close();
|
||||
});
|
||||
|
||||
$('.dialogConfirmReset-confirmbtn').click(function() {
|
||||
dialogConfirmReset.close();
|
||||
MSP.send_message(MSPCodes.MSP_RESET_CONF, false, false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('initialSetupSettingsRestored'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue