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.
|
||||
switch (props.name) {
|
||||
case 'action_save':
|
||||
props = deepFreeze(Object.assign({}, props, {
|
||||
props = deepFreeze(Object.assign({}, {
|
||||
type: 'submit',
|
||||
label: props.title,
|
||||
icon: 'save',
|
||||
}));
|
||||
bootstrapButtonStyle: 'success',
|
||||
}, props));
|
||||
break;
|
||||
case 'action_cancel':
|
||||
props = deepFreeze(Object.assign({}, props, {
|
||||
props = deepFreeze(Object.assign({}, {
|
||||
type: 'button',
|
||||
label: props.title,
|
||||
icon: 'cancel',
|
||||
}));
|
||||
}, props));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user