polishing connect UI

10.3.x-maintenance
cTn 2013-11-22 11:59:38 +01:00
parent 206dc6ab26
commit e99cbcecee
2 changed files with 9 additions and 5 deletions

View File

@ -214,6 +214,8 @@ function process_data(command, message_buffer, message_length_expected) {
// IDENT received, show the tab content
if (!configuration_received) {
configuration_received = true;
$('div#port-picker a.connect').text('Disconnect').addClass('active');
$('#tabs li a:first').click();
}
break;

View File

@ -109,12 +109,11 @@ $(document).ready(function() {
console.log('Connecting to: ' + selected_port);
GUI.connecting_to = selected_port;
chrome.serial.open(selected_port, {
bitrate: selected_baud
}, onOpen);
// lock port select & baud while we are connecting / connected
$('div#port-picker #port, div#port-picker #baud, div#port-picker #delay').prop('disabled', true);
$('div#port-picker a.connect').text('Connecting');
$(this).text('Disconnect');
$(this).addClass('active');
chrome.serial.open(selected_port, {bitrate: selected_baud}, onOpen);
} else {
// Disable any active "data pulling" timer
disable_timers();
@ -135,6 +134,9 @@ $(document).ready(function() {
// reset valid config received variable (used to block tabs while not connected properly)
configuration_received = false;
// unlock port select & baud
$('div#port-picker #port, div#port-picker #baud, div#port-picker #delay').prop('disabled', false);
$(this).text('Connect');
$(this).removeClass('active');
}