Don't display serialout settings unless a serialout device is present.

pull/490/head
Christopher Young 2016-09-19 12:25:23 -04:00
rodzic 30fe7295c4
commit 31bbf1bc1b
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -17,8 +17,10 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
settings = angular.fromJson(data);
// consider using angular.extend()
$scope.rawSettings = angular.toJson(data, true);
$scope.visible_serialout = false;
if ((settings.SerialOutputs !== undefined) && (settings.SerialOutputs !== null) && (settings.SerialOutputs['/dev/serialout0'] !== undefined)) {
$scope.Baud = settings.SerialOutputs['/dev/serialout0'].Baud;
$scope.visible_serialout = true;
}
$scope.UAT_Enabled = settings.UAT_Enabled;
$scope.ES_Enabled = settings.ES_Enabled;

Wyświetl plik

@ -92,7 +92,7 @@
<input class="col-xs-7" type="number_format" required ng-model="PPM" placeholder="integer" ng-blur="updateppm()" />
</form>
</div>
<div class="form-group reset-flow">
<div class="form-group reset-flow" ng-class="{ 'section_invisible': (!visible_serialout)}">
<label class="control-label col-xs-5">Serial Output Baudrate</label>
<form name="ppmForm" ng-submit="updateBaud()" novalidate>
<!-- type="number" not supported except on mobile -->