Skip to content

Commit 5f8532a

Browse files
author
jonisaa
committed
Merge remote-tracking branch 'origin/experimental' into experimental
2 parents fc74918 + dd9add8 commit 5f8532a

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/components/common/Root.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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;

src/factory/BootstrapFactory.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import Checkbox from '../components/field/CheckBox';
1313
import Radio from '../components/field/Radio';
1414
import FileUpload from '../components/field/FileUpload';
1515

16+
import Root from '../components/common/Root';
17+
1618
class 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

4955
export default BootstrapFactory;

0 commit comments

Comments
 (0)