fix "blinking" UI glitch
parent
af22c670e3
commit
809cc427de
123
tabs/servos.css
123
tabs/servos.css
|
@ -0,0 +1,123 @@
|
|||
.tab-servos .supported_wrapper,
|
||||
.tab-servos .direction_wrapper {
|
||||
display: none;
|
||||
}
|
||||
.tab-servos .title {
|
||||
margin-top: 10px;
|
||||
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
||||
border: 1px solid #8b8b8b;
|
||||
border-bottom: 0;
|
||||
|
||||
background-color: #ececec;
|
||||
}
|
||||
.tab-servos table.directions td.direction select {
|
||||
height: 19px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.tab-servos table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.tab-servos table th {
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
|
||||
border: 1px solid #8b8b8b;
|
||||
}
|
||||
.tab-servos table td {
|
||||
line-height: 18px;
|
||||
|
||||
border: 1px solid #8b8b8b;
|
||||
}
|
||||
.tab-servos table .main {
|
||||
font-weight: bold;
|
||||
|
||||
text-align: center;
|
||||
|
||||
background-color: #ececec;
|
||||
}
|
||||
.tab-servos table input[type="number"] {
|
||||
width: 65px;
|
||||
height: 20px;
|
||||
|
||||
padding-right: 5px;
|
||||
|
||||
line-height: 20px;
|
||||
|
||||
text-align: right;
|
||||
}
|
||||
.tab-servos table .channel input[type="checkbox"]:first-child {
|
||||
margin-left: 24px;
|
||||
}
|
||||
.tab-servos table .channel input[type="checkbox"] {
|
||||
margin-top: 4px;
|
||||
margin-right: 21px;
|
||||
}
|
||||
.tab-servos table .direction {
|
||||
}
|
||||
.tab-servos .direction .name {
|
||||
float: left;
|
||||
display: block;
|
||||
|
||||
width: 60px;
|
||||
}
|
||||
.tab-servos .direction .alternate {
|
||||
float: left;
|
||||
display: block;
|
||||
|
||||
width: 60px;
|
||||
}
|
||||
.tab-servos .direction .first {
|
||||
float: left;
|
||||
|
||||
margin: 2px 10px 0 20px;
|
||||
}
|
||||
.tab-servos .direction .second {
|
||||
float: left;
|
||||
|
||||
margin: 2px 10px 0 0;
|
||||
}
|
||||
.tab-servos .direction .rate {
|
||||
width: 200px;
|
||||
height: 20px;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
.tab-servos .live {
|
||||
float: left;
|
||||
|
||||
margin-top: 10px;
|
||||
}
|
||||
.tab-servos .live span {
|
||||
float: left;
|
||||
}
|
||||
.tab-servos .live input {
|
||||
float: left;
|
||||
margin: 0 0 0 5px;
|
||||
}
|
||||
.tab-servos .update {
|
||||
display: block;
|
||||
float: right;
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
width: 120px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
|
||||
font-size: 14px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
|
||||
border: 1px solid silver;
|
||||
|
||||
background-color: #0fab16;
|
||||
}
|
||||
.tab-servos .update:hover {
|
||||
cursor: pointer;
|
||||
background-color: #13d81d;
|
||||
}
|
121
tabs/servos.html
121
tabs/servos.html
|
@ -1,124 +1,3 @@
|
|||
<style type="text/css">
|
||||
.tab-servos .title {
|
||||
margin-top: 10px;
|
||||
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
||||
border: 1px solid #8b8b8b;
|
||||
border-bottom: 0;
|
||||
|
||||
background-color: #ececec;
|
||||
}
|
||||
.tab-servos table.directions td.direction select {
|
||||
height: 19px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.tab-servos table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.tab-servos table th {
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
|
||||
border: 1px solid #8b8b8b;
|
||||
}
|
||||
.tab-servos table td {
|
||||
line-height: 18px;
|
||||
|
||||
border: 1px solid #8b8b8b;
|
||||
}
|
||||
.tab-servos table .main {
|
||||
font-weight: bold;
|
||||
|
||||
text-align: center;
|
||||
|
||||
background-color: #ececec;
|
||||
}
|
||||
.tab-servos table input[type="number"] {
|
||||
width: 65px;
|
||||
height: 20px;
|
||||
|
||||
padding-right: 5px;
|
||||
|
||||
line-height: 20px;
|
||||
|
||||
text-align: right;
|
||||
}
|
||||
.tab-servos table .channel input[type="checkbox"]:first-child {
|
||||
margin-left: 24px;
|
||||
}
|
||||
.tab-servos table .channel input[type="checkbox"] {
|
||||
margin-top: 4px;
|
||||
margin-right: 21px;
|
||||
}
|
||||
.tab-servos table .direction {
|
||||
}
|
||||
.tab-servos .direction .name {
|
||||
float: left;
|
||||
display: block;
|
||||
|
||||
width: 60px;
|
||||
}
|
||||
.tab-servos .direction .alternate {
|
||||
float: left;
|
||||
display: block;
|
||||
|
||||
width: 60px;
|
||||
}
|
||||
.tab-servos .direction .first {
|
||||
float: left;
|
||||
|
||||
margin: 2px 10px 0 20px;
|
||||
}
|
||||
.tab-servos .direction .second {
|
||||
float: left;
|
||||
|
||||
margin: 2px 10px 0 0;
|
||||
}
|
||||
.tab-servos .direction .rate {
|
||||
width: 200px;
|
||||
height: 20px;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
.tab-servos .live {
|
||||
float: left;
|
||||
|
||||
margin-top: 10px;
|
||||
}
|
||||
.tab-servos .live span {
|
||||
float: left;
|
||||
}
|
||||
.tab-servos .live input {
|
||||
float: left;
|
||||
margin: 0 0 0 5px;
|
||||
}
|
||||
.tab-servos .update {
|
||||
display: block;
|
||||
float: right;
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
width: 120px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
|
||||
font-size: 14px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
|
||||
border: 1px solid silver;
|
||||
|
||||
background-color: #0fab16;
|
||||
}
|
||||
.tab-servos .update:hover {
|
||||
cursor: pointer;
|
||||
background-color: #13d81d;
|
||||
}
|
||||
</style>
|
||||
<div class="tab-servos">
|
||||
Model: <strong class="model"></strong>
|
||||
<div class="supported_wrapper">
|
||||
|
|
|
@ -47,9 +47,6 @@ 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
|
||||
|
@ -71,9 +68,6 @@ 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
|
||||
|
@ -93,9 +87,6 @@ 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');
|
||||
|
@ -109,12 +100,6 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,6 +187,8 @@ function servos_update(save_to_eeprom) {
|
|||
}
|
||||
|
||||
function process_directions(name, obj, bitpos) {
|
||||
$('div.direction_wrapper').show();
|
||||
|
||||
var val;
|
||||
|
||||
$('div.tab-servos table.directions').append('\
|
||||
|
@ -223,7 +210,9 @@ function process_directions(name, obj, bitpos) {
|
|||
$('div.tab-servos table.directions tr:last select').data('info', {'obj': obj, 'bitpos': bitpos});
|
||||
}
|
||||
|
||||
function process_servos(name, alternate, obj, directions) {
|
||||
function process_servos(name, alternate, obj, directions) {
|
||||
$('div.supported_wrapper').show();
|
||||
|
||||
$('div.tab-servos table.fields').append('\
|
||||
<tr> \
|
||||
<td style="text-align: center">' + name + '</td>\
|
||||
|
|
Loading…
Reference in New Issue