mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
better handling of wrong baud rate
+ some tiny UI changes due to the #content change for mac os x which kinda broke the "floating" tabs hack with absolute position
This commit is contained in:
parent
b477d1511a
commit
b892fcb376
3 changed files with 18 additions and 22 deletions
|
@ -124,29 +124,14 @@ a:hover {
|
||||||
background-color: #0d8b13;
|
background-color: #0d8b13;
|
||||||
}
|
}
|
||||||
#tabs {
|
#tabs {
|
||||||
position: absolute;
|
|
||||||
margin-top: 1px;
|
|
||||||
}
|
}
|
||||||
#tabs li {
|
#tabs li {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
|
||||||
border: 1px solid #848484;
|
border: 1px solid #848484;
|
||||||
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
#tabs li.first {
|
|
||||||
}
|
|
||||||
#tabs li.last {
|
|
||||||
}
|
|
||||||
#tabs li.active {
|
|
||||||
border-bottom: 1px solid white;
|
|
||||||
}
|
|
||||||
#tabs li.active a {
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
#tabs li.active a:hover {
|
|
||||||
background-color: white;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
#tabs li a {
|
#tabs li a {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
|
@ -161,17 +146,23 @@ a:hover {
|
||||||
#tabs li a:hover {
|
#tabs li a:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
background-color: #acacac;
|
background-color: #acacac;
|
||||||
}
|
}
|
||||||
#content {
|
#tabs li.active a {
|
||||||
margin-top: 27px;
|
background-color: white;
|
||||||
|
}
|
||||||
|
#tabs li.active a:hover {
|
||||||
|
cursor: default;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
#content {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|
||||||
background-color: white;
|
background-color: white;
|
||||||
height: 480px;
|
height: 480px;
|
||||||
|
|
||||||
border: 1px solid #848484;
|
border: 1px solid #848484;
|
||||||
-webkit-transform: rotateX(0deg);
|
|
||||||
|
-webkit-transform: rotateX(0deg); /* DO NOT REMOVE! this fixes the UI freezing bug on MAC OS X */
|
||||||
}
|
}
|
||||||
#status-bar {
|
#status-bar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
@ -4,7 +4,7 @@ $(document).ready(function() {
|
||||||
tabs = $('#tabs > ul');
|
tabs = $('#tabs > ul');
|
||||||
$('a', tabs).click(function() {
|
$('a', tabs).click(function() {
|
||||||
if ($(this).parent().hasClass('active') == false) { // only initialize when the tab isn't already active
|
if ($(this).parent().hasClass('active') == false) { // only initialize when the tab isn't already active
|
||||||
if (connectionId < 1) { // if there is no active connection, return
|
if (connectionId < 1 || configuration_received == false) { // if there is no active connection, return
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
var connectionId = -1;
|
var connectionId = -1;
|
||||||
var connection_delay = 0; // delay which defines "when" will the configurator request configurator data after connection was established
|
var connection_delay = 0; // delay which defines "when" will the configurator request configurator data after connection was established
|
||||||
|
var configuration_received = false;
|
||||||
|
|
||||||
var MSP_codes = {
|
var MSP_codes = {
|
||||||
MSP_IDENT: 100,
|
MSP_IDENT: 100,
|
||||||
|
@ -170,6 +171,9 @@ $(document).ready(function() {
|
||||||
// Change port utilization to 0
|
// Change port utilization to 0
|
||||||
$('span.port-usage').html('0%');
|
$('span.port-usage').html('0%');
|
||||||
|
|
||||||
|
// reset valid config received variable (used to block tabs while not connected properly)
|
||||||
|
configuration_received = false;
|
||||||
|
|
||||||
$(this).text('Connect');
|
$(this).text('Connect');
|
||||||
$(this).removeClass('active');
|
$(this).removeClass('active');
|
||||||
} else { // even number of clicks
|
} else { // even number of clicks
|
||||||
|
@ -412,6 +416,7 @@ function process_message(code, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDENT received, show the tab content
|
// IDENT received, show the tab content
|
||||||
|
configuration_received = true;
|
||||||
$('#tabs li a:first').click();
|
$('#tabs li a:first').click();
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_STATUS:
|
case MSP_codes.MSP_STATUS:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue