mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	GUAC-1176: Generalize form fields by removing the value property. Add type-specific convenience classes for each field.
This commit is contained in:
		| @@ -29,12 +29,12 @@ angular.module('form').controller('checkboxFieldController', ['$scope', | ||||
|  | ||||
|     // Update typed value when model is changed | ||||
|     $scope.$watch('model', function modelChanged(model) { | ||||
|         $scope.typedValue = (model === $scope.field.value); | ||||
|         $scope.typedValue = (model === $scope.field.options[0].value); | ||||
|     }); | ||||
|  | ||||
|     // Update string value in model when typed value is changed | ||||
|     $scope.$watch('typedValue', function typedValueChanged(typedValue) { | ||||
|         $scope.model = (typedValue ? $scope.field.value : ''); | ||||
|         $scope.model = (typedValue ? $scope.field.options[0].value : ''); | ||||
|     }); | ||||
|  | ||||
| }]); | ||||
|   | ||||
| @@ -64,16 +64,7 @@ angular.module('rest').factory('Field', [function defineField() { | ||||
|         this.type = template.type || Field.Type.TEXT; | ||||
|  | ||||
|         /** | ||||
|          * The value to set the parameter to, in the case of a BOOLEAN | ||||
|          * parameter, to enable that parameter's effect. | ||||
|          * | ||||
|          * @type String | ||||
|          */ | ||||
|         this.value = template.value; | ||||
|  | ||||
|         /** | ||||
|          * All possible legal values for this parameter. This property is only | ||||
|          * applicable to ENUM type parameters. | ||||
|          * All possible legal values for this parameter. | ||||
|          * | ||||
|          * @type FieldOption[] | ||||
|          */ | ||||
| @@ -123,7 +114,9 @@ angular.module('rest').factory('Field', [function defineField() { | ||||
|         /** | ||||
|          * The type string associated with parameters that may contain only a | ||||
|          * single possible value, where that value enables the parameter's | ||||
|          * effect. | ||||
|          * effect. It is assumed that each BOOLEAN field will provide exactly | ||||
|          * one possible value (option), which will be the value if that field | ||||
|          * is true. | ||||
|          *  | ||||
|          * @type String | ||||
|          */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user