File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ import React , { Component , PropTypes } from 'react' ;
2+
3+
4+ const Root = ( { fieldLayout, children, handleSubmit} ) => {
5+
6+
7+ // Setting the form class name to "form-horizontal" only affects Bootstrap.
8+ // ToDo: Make the UI to provide the form class name or the entire Form component
9+ let formClassName = ( fieldLayout == 'inline' ) ? "form-horizontal" : "" ;
10+
11+ return (
12+ < div className = "meta-form" >
13+ < form onSubmit = { handleSubmit } className = { formClassName } >
14+ { children }
15+ </ form >
16+ </ div >
17+ ) ;
18+ } ;
19+
20+ export default Root ;
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import Checkbox from '../components/field/CheckBox';
1313import Radio from '../components/field/Radio' ;
1414import FileUpload from '../components/field/FileUpload' ;
1515
16+ import Root from '../components/common/Root' ;
17+
1618class BootstrapFactory extends ComponentFactory {
1719 constructor ( config ) {
1820 super ( ) ;
@@ -44,6 +46,10 @@ class BootstrapFactory extends ComponentFactory {
4446 this . setDefaultGroupComponent ( 'Group' ) ;
4547 } ;
4648
49+ getRoot = ( ) => {
50+ return Root ;
51+ }
52+
4753}
4854
4955export default BootstrapFactory ;
You can’t perform that action at this time.
0 commit comments