change button bg color while calibrating

10.3.x-maintenance
cTn 2013-11-12 05:16:05 +01:00
parent 6715326a44
commit 3d58387f62
2 changed files with 30 additions and 2 deletions

View File

@ -221,6 +221,14 @@ a:hover {
.tab-initial_setup .section a:hover {
background-color: #424d84;
}
.tab-initial_setup .section a.calibrating {
background-color: #4f4f4f;
}
.tab-initial_setup .section a.calibrating:hover {
cursor: default;
background-color: #4f4f4f;
}
.tab-initial_setup .section a.backup {
width: 75px;
margin-right: 10px;

View File

@ -76,11 +76,31 @@ function tab_initialize_initial_setup() {
// UI Hooks
$('a.calibrateAccel').click(function() {
send_message(MSP_codes.MSP_ACC_CALIBRATION, MSP_codes.MSP_ACC_CALIBRATION);
var self = $(this);
if (!self.hasClass('calibrating')) {
self.addClass('calibrating');
send_message(MSP_codes.MSP_ACC_CALIBRATION, MSP_codes.MSP_ACC_CALIBRATION);
GUI.timeout_add('button_reset', function() {
self.removeClass('calibrating');
}, 1000);
}
});
$('a.calibrateMag').click(function() {
send_message(MSP_codes.MSP_MAG_CALIBRATION, MSP_codes.MSP_MAG_CALIBRATION);
var self = $(this);
if (!self.hasClass('calibrating')) {
self.addClass('calibrating');
send_message(MSP_codes.MSP_MAG_CALIBRATION, MSP_codes.MSP_MAG_CALIBRATION);
GUI.timeout_add('button_reset', function() {
self.removeClass('calibrating');
}, 30000);
}
});
$('a.resetSettings').click(function() {