guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [1/2] incubator-guacamole-client git commit: GUACAMOLE-204: Do not display field headers, etc. if the field itself has no content whatsoever.
Date Wed, 29 Mar 2017 18:29:38 GMT
Repository: incubator-guacamole-client
Updated Branches:
  refs/heads/master bdd352614 -> 7c1865012


GUACAMOLE-204: Do not display field headers, etc. if the field itself has no content whatsoever.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/6c5cdae1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/6c5cdae1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/6c5cdae1

Branch: refs/heads/master
Commit: 6c5cdae1529e288e507dc57561cc918ae29442e7
Parents: 3188adb
Author: Michael Jumper <mjumper@apache.org>
Authored: Mon Mar 27 22:32:53 2017 -0700
Committer: Michael Jumper <mjumper@apache.org>
Committed: Mon Mar 27 22:32:53 2017 -0700

----------------------------------------------------------------------
 .../src/main/webapp/app/form/directives/formField.js     | 11 +++++++++++
 .../src/main/webapp/app/form/templates/formField.html    |  5 ++---
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/6c5cdae1/guacamole/src/main/webapp/app/form/directives/formField.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/form/directives/formField.js b/guacamole/src/main/webapp/app/form/directives/formField.js
index 2de0d49..31be836 100644
--- a/guacamole/src/main/webapp/app/form/directives/formField.js
+++ b/guacamole/src/main/webapp/app/form/directives/formField.js
@@ -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) {
 

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/6c5cdae1/guacamole/src/main/webapp/app/form/templates/formField.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/form/templates/formField.html b/guacamole/src/main/webapp/app/form/templates/formField.html
index f8d3303..45cf6b9 100644
--- a/guacamole/src/main/webapp/app/form/templates/formField.html
+++ b/guacamole/src/main/webapp/app/form/templates/formField.html
@@ -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>


Mime
View raw message