Skip to content

Commit

Permalink
add disabled option to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
k3ssen committed Apr 17, 2021
1 parent dcc42b0 commit 2e90895
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Resources/assets/components/Form/FormWidgetMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export default class FormWidgetMixin extends Vue {
attr['error'] = !!this.form.vars.errors;
attr['persistent-hint'] = !!this.form.vars.help;

if (this.form.vars.disabled) {
attr['disabled'] = true;
}
if (this.form.vars.required) {
attr['required'] = true;
}
if (!this.form.vars.multiple) {
attr['name'] = this.form.vars.full_name;
}
Expand Down
1 change: 1 addition & 0 deletions Resources/assets/components/Form/IForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface IFormVars {
btn_add_txt?: string;
btn_delete_txt?: string;
required: boolean;
disabled?: boolean;
compound: boolean;
multiple?: boolean;
prototype?: any;
Expand Down

0 comments on commit 2e90895

Please sign in to comment.