polishing connect UI
parent
206dc6ab26
commit
e99cbcecee
|
@ -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;
|
||||||
|
|
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue