1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 01:05:15 +03:00

make firmware_flasher button toggle

This commit is contained in:
timman2er 2018-10-06 12:22:08 +02:00
parent 51a09e244f
commit 36962fe2dc
3 changed files with 19 additions and 10 deletions

View file

@ -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 () {
$('#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');
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');
}