From 6055f73f94e95e090da8a98b6fda29dc632be079 Mon Sep 17 00:00:00 2001 From: TheAngularity Date: Fri, 22 Jul 2016 13:08:50 +0200 Subject: [PATCH] replace bit_check with have_sensor for better readable, cleanups --- tabs/sensors.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tabs/sensors.js b/tabs/sensors.js index 9d5192c0..6b14b663 100644 --- a/tabs/sensors.js +++ b/tabs/sensors.js @@ -185,16 +185,16 @@ TABS.sensors.initialize = function (callback) { // disable graphs for sensors that are missing var checkboxes = $('.tab-sensors .info .checkboxes input'); - if (!have_sensor(CONFIG.activeSensors, 'acc')) { // acc + if (!have_sensor(CONFIG.activeSensors, 'acc')) { checkboxes.eq(1).prop('disabled', true); } - if (!bit_check(CONFIG.activeSensors, 1)) { // baro - checkboxes.eq(3).prop('disabled', true); - } - if (!bit_check(CONFIG.activeSensors, 2)) { // mag + if (!have_sensor(CONFIG.activeSensors, 'mag')) { checkboxes.eq(2).prop('disabled', true); } - if (!bit_check(CONFIG.activeSensors, 4)) { // sonar + if (!have_sensor(CONFIG.activeSensors, 'baro')) { + checkboxes.eq(3).prop('disabled', true); + } + if (!have_sensor(CONFIG.activeSensors, 'sonar')) { checkboxes.eq(4).prop('disabled', true); }