mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
initial stab on preventing tab switch chaining
This commit is contained in:
parent
795502a585
commit
3f063f6654
3 changed files with 7 additions and 1 deletions
|
@ -3,6 +3,7 @@ var GUI_control = function() {
|
|||
this.connecting_to = false;
|
||||
this.connected_to = false;
|
||||
this.active_tab;
|
||||
this.tab_switch_in_progress = false;
|
||||
this.operating_system;
|
||||
this.optional_usb_permissions = false; // controlled by usb permissions code
|
||||
this.interval_array = [];
|
||||
|
|
|
@ -22,6 +22,7 @@ $(document).ready(function() {
|
|||
GUI.timeout_kill_all();
|
||||
GUI.interval_kill_all();
|
||||
GUI.tab_switch_cleanup();
|
||||
GUI.tab_switch_in_progress = false;
|
||||
|
||||
serial.disconnect(onClosed);
|
||||
|
||||
|
|
6
main.js
6
main.js
|
@ -49,7 +49,7 @@ $(document).ready(function() {
|
|||
// Tabs
|
||||
var tabs = $('#tabs > ul');
|
||||
$('a', tabs).click(function() {
|
||||
if ($(this).parent().hasClass('active') == false) { // only initialize when the tab isn't already active
|
||||
if ($(this).parent().hasClass('active') == false && !GUI.tab_switch_in_progress) { // only initialize when the tab isn't already active
|
||||
var self = this;
|
||||
var index = $(self).parent().index();
|
||||
var tab = $(self).parent().prop('class');
|
||||
|
@ -60,6 +60,8 @@ $(document).ready(function() {
|
|||
return;
|
||||
}
|
||||
|
||||
GUI.tab_switch_in_progress = true;
|
||||
|
||||
GUI.tab_switch_cleanup(function() {
|
||||
// disable previously active tab highlight
|
||||
$('li', tabs).removeClass('active');
|
||||
|
@ -102,6 +104,8 @@ $(document).ready(function() {
|
|||
tab_initialize_logging();
|
||||
break;
|
||||
}
|
||||
|
||||
GUI.tab_switch_in_progress = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue