1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-17 21:35:30 +03:00
inav-configurator/js/main.js
2013-04-08 21:10:47 +02:00

22 lines
No EOL
914 B
JavaScript

$(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);
}
}
});
});