1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 06:15:13 +03:00

load mixer config on demand

This commit is contained in:
Kiripolszky Károly 2018-07-22 10:49:04 +02:00
parent f71dcb9c3c
commit c4e9d1778c
5 changed files with 18 additions and 12 deletions

View file

@ -323,17 +323,11 @@ GUI_control.prototype.content_ready = function (callback) {
GUI_control.prototype.selectDefaultTabWhenConnected = function() { GUI_control.prototype.selectDefaultTabWhenConnected = function() {
chrome.storage.local.get(['rememberLastTab', 'lastTab'], function (result) { chrome.storage.local.get(['rememberLastTab', 'lastTab'], function (result) {
let fallbackTab = '#tabs ul.mode-connected .tab_setup a';
if (!(result.rememberLastTab && !!result.lastTab)) { if (!(result.rememberLastTab && !!result.lastTab)) {
$(fallbackTab).click(); $('#tabs ul.mode-connected .tab_setup a').click();
return; return;
} }
let $savedTab = $("#tabs ul.mode-connected ." + result.lastTab + " a"); $("#tabs ul.mode-connected ." + result.lastTab + " a").click();
if (!!$savedTab.data("ignore-reopen")) {
$(fallbackTab).click();
} else {
$savedTab.click();
}
}); });
}; };

View file

@ -98,7 +98,7 @@ function startProcess() {
GUI.tab_switch_cleanup(function () { GUI.tab_switch_cleanup(function () {
// disable previously active tab highlight // disable previously active tab highlight
$('li', ui_tabs).removeClass('active'); $('li', ui_tabs).removeClass('active');
// Highlight selected tab // Highlight selected tab
$(self).parent().addClass('active'); $(self).parent().addClass('active');

View file

@ -45,7 +45,11 @@ TABS.motors.initialize = function (callback) {
} }
function load_motor_data() { function load_motor_data() {
MSP.send_message(MSPCodes.MSP_MOTOR, false, false, load_html); MSP.send_message(MSPCodes.MSP_MOTOR, false, false, load_mixer_config);
}
function load_mixer_config() {
MSP.send_message(MSPCodes.MSP_MIXER_CONFIG, false, false, load_html);
} }
function load_html() { function load_html() {

View file

@ -39,9 +39,13 @@ TABS.pid_tuning.initialize = function (callback) {
}).then(function() { }).then(function() {
return MSP.promise(MSPCodes.MSP_RC_DEADBAND); return MSP.promise(MSPCodes.MSP_RC_DEADBAND);
}).then(function() { }).then(function() {
$('#content').load("./tabs/pid_tuning.html", process_html); MSP.send_message(MSPCodes.MSP_MIXER_CONFIG, false, false, load_html);
}); });
function load_html() {
$('#content').load("./tabs/pid_tuning.html", process_html);
}
function pid_and_rc_to_form() { function pid_and_rc_to_form() {
self.setProfile(); self.setProfile();
if (semver.gte(CONFIG.apiVersion, "1.20.0")) { if (semver.gte(CONFIG.apiVersion, "1.20.0")) {

View file

@ -40,7 +40,7 @@ TABS.receiver.initialize = function (callback) {
} }
function load_rx_config() { function load_rx_config() {
var next_callback = load_html; var next_callback = load_mixer_config;
if (semver.gte(CONFIG.apiVersion, "1.20.0")) { if (semver.gte(CONFIG.apiVersion, "1.20.0")) {
MSP.send_message(MSPCodes.MSP_RX_CONFIG, false, false, next_callback); MSP.send_message(MSPCodes.MSP_RX_CONFIG, false, false, next_callback);
} else { } else {
@ -48,6 +48,10 @@ TABS.receiver.initialize = function (callback) {
} }
} }
function load_mixer_config() {
MSP.send_message(MSPCodes.MSP_MIXER_CONFIG, false, false, load_html);
}
function load_html() { function load_html() {
$('#content').load("./tabs/receiver.html", process_html); $('#content').load("./tabs/receiver.html", process_html);
} }