1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

visual indicators for successful save to eeprom

close #20
This commit is contained in:
cTn 2014-01-22 19:05:52 +01:00
parent 98c587c3d9
commit eaeda19842
10 changed files with 63 additions and 13 deletions

View file

@ -6,7 +6,7 @@ function tab_initialize_auxiliary_configuration() {
send_message(MSP_codes.MSP_BOX, MSP_codes.MSP_BOX, false, function() {
// generate table from the supplied AUX names and AUX data
for (var i = 0; i < AUX_CONFIG.length; i++) {
$('.tab-auxiliary_configuration .boxes > tbody:last').append(
$('.boxes > tbody:last').append(
'<tr>' +
'<td class="name">' + AUX_CONFIG[i] + '</td>' +
box_check(AUX_CONFIG_values[i], 0) +
@ -29,11 +29,11 @@ function tab_initialize_auxiliary_configuration() {
}
// UI Hooks
$('.tab-auxiliary_configuration a.update').click(function() {
$('a.update').click(function() {
// catch the input changes
var main_needle = 0;
var needle = 0;
$('.tab-auxiliary_configuration .boxes input').each(function() {
$('.boxes input').each(function() {
if ($(this).is(':checked')) {
AUX_CONFIG_values[main_needle] = bit_set(AUX_CONFIG_values[main_needle], needle);
} else {
@ -61,7 +61,14 @@ function tab_initialize_auxiliary_configuration() {
send_message(MSP_codes.MSP_SET_BOX, AUX_val_buffer_out);
// Save changes to EEPROM
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE);
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE, false, function() {
var element = $('a.update');
element.addClass('success');
GUI.timeout_add('success_highlight', function() {
element.removeClass('success');
}, 2000);
});
});
// enable data pulling