Remove now-unnecessary valuesOnly attribute of guacForm (reverts 4d7841a).
@@ -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,19 +184,15 @@ 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];
+ // All fields are visible if contents are not restricted to
+ // model properties only
+ if (!$scope.modelOnly)
+ return true;
- // Forms with modelOnly set should display only fields with
- // associated properties in the model object
- if ($scope.modelOnly)
+ // Otherwise, fields are only visible if they are present
+ // within the model
return field && (field.name in $scope.values);
- // Otherwise, all fields are visible
- return true;
-
};
/**
