mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Allow form action props override in FormBuilder
Also added bootstrapButtonStyle defaults
This commit is contained in:
parent
78a385c16a
commit
b0d4283c17
@ -323,18 +323,19 @@ export class FormBuilderComponent extends SilverStripeComponent {
|
|||||||
// Add sensible defaults for common actions.
|
// Add sensible defaults for common actions.
|
||||||
switch (props.name) {
|
switch (props.name) {
|
||||||
case 'action_save':
|
case 'action_save':
|
||||||
props = deepFreeze(Object.assign({}, props, {
|
props = deepFreeze(Object.assign({}, {
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
label: props.title,
|
label: props.title,
|
||||||
icon: 'save',
|
icon: 'save',
|
||||||
}));
|
bootstrapButtonStyle: 'success',
|
||||||
|
}, props));
|
||||||
break;
|
break;
|
||||||
case 'action_cancel':
|
case 'action_cancel':
|
||||||
props = deepFreeze(Object.assign({}, props, {
|
props = deepFreeze(Object.assign({}, {
|
||||||
type: 'button',
|
type: 'button',
|
||||||
label: props.title,
|
label: props.title,
|
||||||
icon: 'cancel',
|
icon: 'cancel',
|
||||||
}));
|
}, props));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user