mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 14:25:14 +03:00
initial support for tab UI setup
This commit is contained in:
parent
3c67b3d9dc
commit
9fda14b5f2
8 changed files with 108 additions and 9 deletions
22
js/main.js
22
js/main.js
|
@ -0,0 +1,22 @@
|
|||
$(document).ready(function() {
|
||||
var tabs = $('#tabs > ul');
|
||||
$('a', tabs).click(function() {
|
||||
if ($(this).parent().hasClass('active') == false) { // only initialize when the tab isn't already active
|
||||
if (connectionId < 1) { // if there is no active connection, return
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable previous active button
|
||||
$('li', tabs).removeClass('active');
|
||||
|
||||
// Highlight selected button
|
||||
$(this).parent().addClass('active');
|
||||
|
||||
if ($(this).parent().hasClass('tab_initial_setup')) {
|
||||
$('#content').load("./tabs/initial_setup.html", tab_initialize_initial_setup);
|
||||
} else if ($(this).parent().hasClass('tab_pid_tuning')) {
|
||||
$('#content').load("./tabs/pid_tuning.html", tab_initialize_pid_tuning);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue