GUACAMOLE-204: Merge auto-hiding of field headers.

This commit is contained in:
James Muehlner
2017-03-29 11:27:18 -07:00
2 changed files with 13 additions and 3 deletions

View File

@@ -96,6 +96,17 @@ angular.module('form').directive('guacFormField', [function formField() {
};
/**
* Returns whether the current field should be displayed.
*
* @returns {Boolean}
* true if the current field should be displayed, false
* otherwise.
*/
$scope.isFieldVisible = function isFieldVisible() {
return fieldContent[0].hasChildNodes();
};
// Update field contents when field definition is changed
$scope.$watch('field', function setField(field) {

View File

@@ -1,10 +1,9 @@
<label class="labeled-field" ng-class="{empty: !model}">
<label class="labeled-field" ng-class="{empty: !model}" ng-show="isFieldVisible()">
<!-- Field header -->
<span class="field-header">{{getFieldHeader() | translate}}</span>
<!-- Field content -->
<div class="form-field">
</div>
<div class="form-field"></div>
</label>