From ac02c9ac5ece3f7ff8fa8eabebec9c69abec4f94 Mon Sep 17 00:00:00 2001 From: cTn Date: Sun, 8 Dec 2013 20:19:49 +0100 Subject: [PATCH] disable servo ui when its not necessary --- tabs/servos.html | 46 +++++++++++++++++++++++++--------------------- tabs/servos.js | 15 +++++++++++++++ 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/tabs/servos.html b/tabs/servos.html index 2c59a21b05..a71a64ccbc 100644 --- a/tabs/servos.html +++ b/tabs/servos.html @@ -121,26 +121,30 @@
Model: -
Gyroscope / Accelerometer Direction
- - - - - -
NameDirection
-
Change Direction in TX To Match
- - - - - - - - - -
NameMIDMINMAXThrot | Roll | Pitch | Yaw | AUX1 | AUX2 | AUX3 | AUX4Direction
-
- Enable Live mode: +
+
+
Gyroscope / Accelerometer Direction
+ + + + + +
NameDirection
+
+
Change Direction in TX To Match
+ + + + + + + + + +
NameMIDMINMAXThrot | Roll | Pitch | Yaw | AUX1 | AUX2 | AUX3 | AUX4Direction
+
+ Enable Live mode: +
+ Save
- Save
\ No newline at end of file diff --git a/tabs/servos.js b/tabs/servos.js index ff0904b7c0..e01b883a8c 100644 --- a/tabs/servos.js +++ b/tabs/servos.js @@ -47,6 +47,9 @@ function tab_initialize_servos() { // rate process_servos('Pitch Servo', '', 0, 2); process_servos('Roll Servo', '', 1, 2); + + // gyro / acc direction is not shown in this model + $('div.direction_wrapper').hide(); break; case 8: // Flying Wing // looking ok so far @@ -68,6 +71,9 @@ function tab_initialize_servos() { process_servos('Wing 2', '', 4, 2); process_servos('Rudd', '', 5, 2); process_servos('Elev', '', 6, 2); + + // gyro / acc direction is not shown in this model + $('div.direction_wrapper').hide(); break; case 20: // Dualcopter // looking ok so far @@ -87,6 +93,9 @@ function tab_initialize_servos() { process_servos('Left', 'L YAW', 4, true); process_servos('Front', 'F YAW', 5, true); process_servos('Rear', 'YAW', 6, true); + + // gyro / acc direction is not shown in this model + $('div.direction_wrapper').hide(); break; default: model.html('Doesn\'t support servos'); @@ -100,6 +109,12 @@ function tab_initialize_servos() { // rate process_servos('Pitch Servo', '', 0, 2); process_servos('Roll Servo', '', 1, 2); + + // gyro / acc direction is not shown in this model + $('div.direction_wrapper').hide(); + } else { + // disable UI + $('div.supported_wrapper').hide(); } }