GUACAMOLE-292: Remove now-unnecessary valuesOnly attribute of guacForm (reverts 
4d7841a).


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/203afd10
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/203afd10
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/203afd10

Branch: refs/heads/master
Commit: 203afd109911e2a4778b9cbf7b1fb792b5e16b4b
Parents: a34d3fa
Author: Michael Jumper <[email protected]>
Authored: Fri May 26 20:25:12 2017 -0700
Committer: Michael Jumper <[email protected]>
Committed: Sat May 27 11:28:14 2017 -0700

----------------------------------------------------------------------
 .../src/main/webapp/app/form/directives/form.js | 29 ++++++--------------
 1 file changed, 8 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/203afd10/guacamole/src/main/webapp/app/form/directives/form.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/form/directives/form.js 
b/guacamole/src/main/webapp/app/form/directives/form.js
index a6d44f3..518db7d 100644
--- a/guacamole/src/main/webapp/app/form/directives/form.js
+++ b/guacamole/src/main/webapp/app/form/directives/form.js
@@ -64,16 +64,7 @@ angular.module('form').directive('guacForm', [function 
form() {
              *
              * @type Boolean
              */
-            modelOnly : '=',
-
-            /**
-             * Whether the contents of the form should be restricted to those
-             * fields/forms which have associated values defined within the
-             * given model object. By default, all fields will be shown.
-             *
-             * @type Boolean
-             */
-            valuesOnly : '='
+            modelOnly : '='
 
         },
         templateUrl: 'app/form/templates/form.html',
@@ -193,18 +184,14 @@ angular.module('form').directive('guacForm', [function 
form() {
              */
             $scope.isVisible = function isVisible(field) {
 
-                // Forms with valuesOnly set should display only fields with
-                // associated values in the model object
-                if ($scope.valuesOnly)
-                    return field && $scope.values[field.name];
-
-                // Forms with modelOnly set should display only fields with
-                // associated properties in the model object
-                if ($scope.modelOnly)
-                    return field && (field.name in $scope.values);
+                // All fields are visible if contents are not restricted to
+                // model properties only
+                if (!$scope.modelOnly)
+                    return true;
 
-                // Otherwise, all fields are visible
-                return true;
+                // Otherwise, fields are only visible if they are present
+                // within the model
+                return field && (field.name in $scope.values);
 
             };
 

Reply via email to