diff --git a/js/port_handler.js b/js/port_handler.js index fe2e9610..88e022b3 100755 --- a/js/port_handler.js +++ b/js/port_handler.js @@ -135,6 +135,7 @@ PortHandler.check = function () { check_usb_devices(); } + GUI.updateManualPortVisibility(); setTimeout(function () { self.check(); }, 250); @@ -252,4 +253,4 @@ PortHandler.flush_callbacks = function () { } return killed; -}; \ No newline at end of file +}; diff --git a/js/serial_backend.js b/js/serial_backend.js index 0780e6ed..cc0d1e33 100755 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -2,7 +2,7 @@ $(document).ready(function () { - var updateManualPortVisibility = function(){ + GUI.updateManualPortVisibility = function(){ if ($('div#port-picker #port option:selected').data().isManual) { $('#port-override-option').show(); } @@ -11,7 +11,7 @@ $(document).ready(function () { } }; - updateManualPortVisibility(); + GUI.updateManualPortVisibility(); $('#port-override').change(function () { chrome.storage.local.set({'portOverride': $('#port-override').val()}); @@ -22,7 +22,7 @@ $(document).ready(function () { }); $('div#port-picker #port').change(function (target) { - updateManualPortVisibility(); + GUI.updateManualPortVisibility(); }); $('div#port-picker a.connect').click(function () { @@ -53,7 +53,7 @@ $(document).ready(function () { serial.disconnect(onClosed); var wasConnected = CONFIGURATOR.connectionValid; - + GUI.connected_to = false; CONFIGURATOR.connectionValid = false; GUI.allowedTabs = GUI.defaultAllowedTabsWhenDisconnected.slice(); @@ -79,7 +79,7 @@ $(document).ready(function () { // detach listeners and remove element data $('#content').empty(); } - + $('#tabs .tab_landing a').click(); } @@ -172,36 +172,36 @@ function onOpen(openInfo) { if (semver.gte(CONFIG.apiVersion, CONFIGURATOR.apiVersionAccepted)) { MSP.send_message(MSP_codes.MSP_FC_VARIANT, false, false, function () { - + MSP.send_message(MSP_codes.MSP_FC_VERSION, false, false, function () { - + googleAnalytics.sendEvent('Firmware', 'Variant', CONFIG.flightControllerIdentifier + ',' + CONFIG.flightControllerVersion); GUI.log(chrome.i18n.getMessage('fcInfoReceived', [CONFIG.flightControllerIdentifier, CONFIG.flightControllerVersion])); - + MSP.send_message(MSP_codes.MSP_BUILD_INFO, false, false, function () { - + googleAnalytics.sendEvent('Firmware', 'Using', CONFIG.buildInfo); GUI.log(chrome.i18n.getMessage('buildInfoReceived', [CONFIG.buildInfo])); - + MSP.send_message(MSP_codes.MSP_BOARD_INFO, false, false, function () { - + googleAnalytics.sendEvent('Board', 'Using', CONFIG.boardIdentifier + ',' + CONFIG.boardVersion); GUI.log(chrome.i18n.getMessage('boardInfoReceived', [CONFIG.boardIdentifier, CONFIG.boardVersion])); - + MSP.send_message(MSP_codes.MSP_UID, false, false, function () { GUI.log(chrome.i18n.getMessage('uniqueDeviceIdReceived', [CONFIG.uid[0].toString(16) + CONFIG.uid[1].toString(16) + CONFIG.uid[2].toString(16)])); - + // continue as usually CONFIGURATOR.connectionValid = true; GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice(); if (semver.lt(CONFIG.apiVersion, "1.4.0")) { GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('led_strip'), 1); } - + GUI.canChangePidController = semver.gte(CONFIG.apiVersion, CONFIGURATOR.pidControllerChangeMinApiVersion); onConnect(); - + $('#tabs ul.mode-connected .tab_setup a').click(); }); }); @@ -254,7 +254,7 @@ function onClosed(result) { $('#tabs ul.mode-connected').hide(); $('#tabs ul.mode-disconnected').show(); - + var documentationButton = $('#button-documentation'); documentationButton.hide(); } @@ -277,7 +277,7 @@ function sensor_status(sensors_detected) { if (sensor_status.previous_sensors_detected == sensors_detected) { return; } - + // set current value sensor_status.previous_sensors_detected = sensors_detected; @@ -359,4 +359,4 @@ function bit_set(num, bit) { function bit_clear(num, bit) { return num & ~(1 << bit); -} \ No newline at end of file +}