mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-742: Provide "disabled" attribute for forms and fields.
This commit is contained in:
@@ -64,7 +64,15 @@ angular.module('form').directive('guacForm', [function form() {
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
modelOnly : '='
|
||||
modelOnly : '=',
|
||||
|
||||
/**
|
||||
* Whether the contents of the form should be rendered as disabled.
|
||||
* By default, form fields are enabled.
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
disabled : '='
|
||||
|
||||
},
|
||||
templateUrl: 'app/form/templates/form.html',
|
||||
|
@@ -53,7 +53,15 @@ angular.module('form').directive('guacFormField', [function formField() {
|
||||
*
|
||||
* @type String
|
||||
*/
|
||||
model : '='
|
||||
model : '=',
|
||||
|
||||
/**
|
||||
* Whether this field should be rendered as disabled. By default,
|
||||
* form fields are enabled.
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
disabled : '='
|
||||
|
||||
},
|
||||
templateUrl: 'app/form/templates/formField.html',
|
||||
|
@@ -213,6 +213,10 @@ angular.module('form').provider('formService', function formServiceProvider() {
|
||||
* model:
|
||||
* The current String value of the field, if any.
|
||||
*
|
||||
* disabled:
|
||||
* A boolean value which is true if the field should be disabled.
|
||||
* If false or undefined, the field should be enabled.
|
||||
*
|
||||
* @param {Element} fieldContainer
|
||||
* The DOM Element whose contents should be replaced with the
|
||||
* compiled field template.
|
||||
|
@@ -1 +1 @@
|
||||
<input type="checkbox" ng-model="typedValue" autocorrect="off" autocapitalize="off"/>
|
||||
<input type="checkbox" ng-disabled="disabled" ng-model="typedValue" autocorrect="off" autocapitalize="off"/>
|
@@ -1,5 +1,6 @@
|
||||
<div class="date-field">
|
||||
<input type="date"
|
||||
ng-disabled="disabled"
|
||||
ng-model="typedValue"
|
||||
ng-model-options="modelOptions"
|
||||
guac-lenient-date
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<div class="email-field">
|
||||
<input type="email"
|
||||
ng-disabled="disabled"
|
||||
ng-model="model"
|
||||
ng-hide="readOnly"
|
||||
autocorrect="off"
|
||||
|
@@ -9,6 +9,7 @@
|
||||
<div class="fields">
|
||||
<guac-form-field ng-repeat="field in form.fields" namespace="namespace"
|
||||
ng-if="isVisible(field)"
|
||||
disabled="disabled"
|
||||
field="field" model="values[field.name]"></guac-form-field>
|
||||
</div>
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
<input type="number" ng-model="typedValue" autocorrect="off" autocapitalize="off"/>
|
||||
<input type="number" ng-disabled="disabled" ng-model="typedValue" autocorrect="off" autocapitalize="off"/>
|
@@ -1,4 +1,4 @@
|
||||
<div class="password-field">
|
||||
<input type="{{passwordInputType}}" ng-model="model" ng-trim="false" autocorrect="off" autocapitalize="off"/>
|
||||
<input type="{{passwordInputType}}" ng-disabled="disabled" ng-model="model" ng-trim="false" autocorrect="off" autocapitalize="off"/>
|
||||
<div class="icon toggle-password" ng-click="togglePassword()" title="{{getTogglePasswordHelpText() | translate}}"></div>
|
||||
</div>
|
@@ -1 +1,2 @@
|
||||
<select ng-model="model" ng-options="option as getFieldOption(option) | translate for option in field.options | orderBy: value"></select>
|
||||
<select ng-model="model" ng-disabled="disabled"
|
||||
ng-options="option as getFieldOption(option) | translate for option in field.options | orderBy: value"></select>
|
@@ -1 +1 @@
|
||||
<textarea ng-model="model" autocorrect="off" autocapitalize="off"></textarea>
|
||||
<textarea ng-model="model" autocorrect="off" autocapitalize="off" ng-disabled="disabled"></textarea>
|
@@ -1,5 +1,6 @@
|
||||
<div class="text-field">
|
||||
<input type="text" ng-model="model" autocorrect="off" autocapitalize="off" ng-attr-list="{{ dataListId }}"/>
|
||||
<input type="text" ng-model="model" autocorrect="off" autocapitalize="off"
|
||||
ng-disabled="disabled" ng-attr-list="{{ dataListId }}"/>
|
||||
<datalist ng-if="dataListId" id="{{ dataListId }}">
|
||||
<option ng-repeat="option in field.options | orderBy: option"
|
||||
value="{{ option }}">{{ getFieldOption(option) | translate }}</option>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<div class="time-field">
|
||||
<input type="time"
|
||||
ng-disabled="disabled"
|
||||
ng-model="typedValue"
|
||||
ng-model-options="modelOptions"
|
||||
guac-lenient-time
|
||||
|
@@ -2,12 +2,13 @@
|
||||
|
||||
<!-- Available time zone regions -->
|
||||
<select class="time-zone-region"
|
||||
ng-disabled="disabled"
|
||||
ng-model="region"
|
||||
ng-options="name for name in regions | orderBy: name"></select>
|
||||
|
||||
<!-- Time zones within selected region -->
|
||||
<select class="time-zone"
|
||||
ng-disabled="!region"
|
||||
ng-disabled="disabled || !region"
|
||||
ng-model="model"
|
||||
ng-options="timeZone.value as timeZone.key for timeZone in timeZones[region] | toArray | orderBy: key"></select>
|
||||
|
||||
|
Reference in New Issue
Block a user