Allow form action props override in FormBuilder

Also added bootstrapButtonStyle defaults
This commit is contained in:
Ingo Schommer 2016-04-26 13:22:54 +12:00
parent 78a385c16a
commit b0d4283c17

View File

@ -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;