mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-204: Merge auto-hiding of field headers.
This commit is contained in:
@@ -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
|
// Update field contents when field definition is changed
|
||||||
$scope.$watch('field', function setField(field) {
|
$scope.$watch('field', function setField(field) {
|
||||||
|
|
||||||
|
@@ -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 -->
|
<!-- Field header -->
|
||||||
<span class="field-header">{{getFieldHeader() | translate}}</span>
|
<span class="field-header">{{getFieldHeader() | translate}}</span>
|
||||||
|
|
||||||
<!-- Field content -->
|
<!-- Field content -->
|
||||||
<div class="form-field">
|
<div class="form-field"></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
Reference in New Issue
Block a user