mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 14:25:14 +03:00
make firmware_flasher button toggle
This commit is contained in:
parent
51a09e244f
commit
36962fe2dc
3 changed files with 19 additions and 10 deletions
|
@ -1556,8 +1556,6 @@ dialog {
|
|||
border: 1px solid #fe0000;
|
||||
background-image: url(../images/icons/cf_icon_flasher_white.svg);
|
||||
transition: none;
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.firmware_b a.flash.active:hover {
|
||||
|
|
|
@ -67,7 +67,7 @@ function initializeSerialBackend() {
|
|||
|
||||
toggleStatus();
|
||||
} else {
|
||||
if ($('div#flashbutton a.flash_state').hasClass('active') && $('div#flashbutton a.flash').addClass('active')) {
|
||||
if ($('div#flashbutton a.flash_state').hasClass('active') && $('div#flashbutton a.flash').hasClass('active')) {
|
||||
$('div#flashbutton a.flash_state').removeClass('active');
|
||||
$('div#flashbutton a.flash').removeClass('active');
|
||||
}
|
||||
|
@ -87,10 +87,21 @@ function initializeSerialBackend() {
|
|||
});
|
||||
|
||||
$('div.open_firmware_flasher a.flash').click(function () {
|
||||
if ($('div#flashbutton a.flash_state').hasClass('active') && $('div#flashbutton a.flash').hasClass('active')) {
|
||||
$('div#flashbutton a.flash_state').removeClass('active');
|
||||
$('div#flashbutton a.flash').removeClass('active');
|
||||
document.getElementById("tab_landing").style.display = "block";
|
||||
document.getElementById("tab_help").style.display = "block";
|
||||
$('#tabs ul.mode-disconnected .tab_landing a').click();
|
||||
}
|
||||
else {
|
||||
$('#tabs ul.mode-disconnected .tab_firmware_flasher a').click();
|
||||
$('div.open_firmware_flasher a.flash_state').text(i18n.getMessage('flashTab'));
|
||||
$('div#flashbutton a.flash_state').addClass('active');
|
||||
$('div#flashbutton a.flash').addClass('active');
|
||||
document.getElementById("tab_landing").style.display = "none";
|
||||
document.getElementById("tab_help").style.display = "none";
|
||||
}
|
||||
});
|
||||
|
||||
// auto-connect
|
||||
|
@ -348,7 +359,7 @@ function connectCli() {
|
|||
}
|
||||
|
||||
function onConnect() {
|
||||
if ($('div#flashbutton a.flash_state').hasClass('active') && $('div#flashbutton a.flash').addClass('active')) {
|
||||
if ($('div#flashbutton a.flash_state').hasClass('active') && $('div#flashbutton a.flash').hasClass('active')) {
|
||||
$('div#flashbutton a.flash_state').removeClass('active');
|
||||
$('div#flashbutton a.flash').removeClass('active');
|
||||
}
|
||||
|
|
|
@ -232,9 +232,9 @@
|
|||
<div class="tab_container">
|
||||
<div id="tabs">
|
||||
<ul class="mode-disconnected">
|
||||
<li class="tab_landing"><a href="#" i18n="tabLanding" class="tabicon ic_welcome" i18n_title="tabLanding"></a>
|
||||
<li class="tab_landing" id="tab_landing"><a href="#" i18n="tabLanding" class="tabicon ic_welcome" i18n_title="tabLanding"></a>
|
||||
</li>
|
||||
<li class="tab_help"><a href="#" i18n="tabHelp" class="tabicon ic_help"
|
||||
<li class="tab_help" id="tab_help"><a href="#" i18n="tabHelp" class="tabicon ic_help"
|
||||
i18n_title="tabHelp"></a></li>
|
||||
<li class="tab_firmware_flasher"><a href="#" i18n="tabFirmwareFlasher" class="tabicon ic_flasher"
|
||||
i18n_title="tabFirmwareFlasher"></a></li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue