AddAddress option buttonType: component manage button in edit or create context

This commit is contained in:
2021-08-17 15:41:03 +02:00
parent 43f9e50100
commit cdc6cf211a
9 changed files with 35 additions and 49 deletions

View File

@@ -145,7 +145,7 @@ export default {
default: {
button: {
text: { create: 'add_an_address_title', edit: 'edit_address' },
type: 'btn-create',
type: { create: 'btn-create', edit: 'btn-update'},
displayText: true
},
title: { create: 'add_an_address_title', edit: 'edit_address' },
@@ -223,13 +223,10 @@ export default {
return (this.context.edit) ? this.default.button.text.edit : this.default.button.text.create;
},
getClassButton() {
let type = this.default.button.type,
size = '';
if (typeof this.options.button !== 'undefined') {
type = this.options.button.type !== null ? this.options.button.type : type;
size = this.options.button.size !== null ? this.options.button.size : size;
}
return size ? `${size} ${type}` : type;
let type = (this.context.edit) ? this.default.button.type.edit : this.default.button.type.create;
let size = (typeof this.options.button !== 'undefined' && this.options.button.size !== null) ?
`${this.options.button.size} ` : '';
return `${size}${type}`;
},
displayTextButton() {
return (typeof this.options.button !== 'undefined' && typeof this.options.button.displayText !== 'undefined') ?