mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-292: Remove now-unnecessary valuesOnly attribute of guacForm (reverts 4d7841a).
This commit is contained in:
@@ -64,16 +64,7 @@ angular.module('form').directive('guacForm', [function form() {
|
|||||||
*
|
*
|
||||||
* @type Boolean
|
* @type Boolean
|
||||||
*/
|
*/
|
||||||
modelOnly : '=',
|
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 : '='
|
|
||||||
|
|
||||||
},
|
},
|
||||||
templateUrl: 'app/form/templates/form.html',
|
templateUrl: 'app/form/templates/form.html',
|
||||||
@@ -193,18 +184,14 @@ angular.module('form').directive('guacForm', [function form() {
|
|||||||
*/
|
*/
|
||||||
$scope.isVisible = function isVisible(field) {
|
$scope.isVisible = function isVisible(field) {
|
||||||
|
|
||||||
// Forms with valuesOnly set should display only fields with
|
// All fields are visible if contents are not restricted to
|
||||||
// associated values in the model object
|
// model properties only
|
||||||
if ($scope.valuesOnly)
|
if (!$scope.modelOnly)
|
||||||
return field && $scope.values[field.name];
|
return true;
|
||||||
|
|
||||||
// Forms with modelOnly set should display only fields with
|
// Otherwise, fields are only visible if they are present
|
||||||
// associated properties in the model object
|
// within the model
|
||||||
if ($scope.modelOnly)
|
return field && (field.name in $scope.values);
|
||||||
return field && (field.name in $scope.values);
|
|
||||||
|
|
||||||
// Otherwise, all fields are visible
|
|
||||||
return true;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user