mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-22 15:55:33 +03:00
only issue is disconnecting on clicking firmware flasher
This commit is contained in:
parent
c337fdc898
commit
8810d353b2
3 changed files with 17 additions and 2 deletions
|
@ -171,6 +171,11 @@ function startProcess() {
|
|||
GUI.tab_switch_in_progress = true;
|
||||
|
||||
GUI.tab_switch_cleanup(function () {
|
||||
// disable active firmware flasher if it was active
|
||||
if ($('div#flashbutton a.flash_state').hasClass('active') && $('div#flashbutton a.flash').addClass('active')) {
|
||||
$('div#flashbutton a.flash_state').removeClass('active');
|
||||
$('div#flashbutton a.flash').removeClass('active');
|
||||
}
|
||||
// disable previously active tab highlight
|
||||
$('li', ui_tabs).removeClass('active');
|
||||
|
||||
|
|
|
@ -67,6 +67,10 @@ function initializeSerialBackend() {
|
|||
|
||||
toggleStatus();
|
||||
} else {
|
||||
if ($('div#flashbutton a.flash_state').hasClass('active') && $('div#flashbutton a.flash').addClass('active')) {
|
||||
$('div#flashbutton a.flash_state').removeClass('active');
|
||||
$('div#flashbutton a.flash').removeClass('active');
|
||||
}
|
||||
GUI.timeout_kill_all();
|
||||
GUI.interval_kill_all();
|
||||
GUI.tab_switch_cleanup();
|
||||
|
@ -82,9 +86,11 @@ function initializeSerialBackend() {
|
|||
}
|
||||
});
|
||||
|
||||
$('div.open_firmware_flasher a.connect').click(function () {
|
||||
$('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');
|
||||
});
|
||||
|
||||
// auto-connect
|
||||
|
@ -342,6 +348,10 @@ function connectCli() {
|
|||
}
|
||||
|
||||
function onConnect() {
|
||||
if ($('div#flashbutton a.flash_state').hasClass('active') && $('div#flashbutton a.flash').addClass('active')) {
|
||||
$('div#flashbutton a.flash_state').removeClass('active');
|
||||
$('div#flashbutton a.flash').removeClass('active');
|
||||
}
|
||||
GUI.timeout_remove('connecting'); // kill connecting timer
|
||||
$('div#connectbutton a.connect_state').text(i18n.getMessage('disconnect')).addClass('active');
|
||||
$('div#connectbutton a.connect').addClass('active');
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
</div>
|
||||
<div class="open_firmware_flasher" id="flashbutton">
|
||||
<div class="firmware_b">
|
||||
<a class="flash disabled" href="#"></a>
|
||||
<a class="flash disabled" href="#"></a> <!-- Note: a.flash points to flash disabled-->
|
||||
</div>
|
||||
<a class="flash_state" i18n="flashTab"></a>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue