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 // IDENT received, show the tab content
if (!configuration_received) { if (!configuration_received) {
configuration_received = true; configuration_received = true;
$('div#port-picker a.connect').text('Disconnect').addClass('active');
$('#tabs li a:first').click(); $('#tabs li a:first').click();
} }
break; break;

View File

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