http.js: fix width property + change default action to append
This commit is contained in:
parent
ca79e18e53
commit
aa33ab4019
2 changed files with 11 additions and 4 deletions
12
src/App.tsx
12
src/App.tsx
|
@ -25,7 +25,7 @@ class App extends React.Component<IAppProps> {
|
|||
super(props);
|
||||
this.state = {
|
||||
isSidebarOpen: true,
|
||||
isSVGSidebarOpen: true,
|
||||
isSVGSidebarOpen: false,
|
||||
configuration: {
|
||||
AvailableContainers: [],
|
||||
AvailableSymbols: [],
|
||||
|
@ -69,11 +69,17 @@ class App extends React.Component<IAppProps> {
|
|||
return;
|
||||
}
|
||||
|
||||
const properties = this.state.configuration.AvailableContainers.find(option => option.Type === type);
|
||||
|
||||
if (properties === undefined) {
|
||||
throw new Error(`[AddContainer] Object type not found. Found: ${type}`);
|
||||
}
|
||||
|
||||
const container = new Container({
|
||||
id: this.state.MainContainer.props.children.length.toString(),
|
||||
x: 0,
|
||||
x: 0 + properties?.Width * this.state.MainContainer.props.children.length,
|
||||
y: 0,
|
||||
width: 300,
|
||||
width: properties?.Width,
|
||||
height: this.state.configuration.MainContainer.Height,
|
||||
children: []
|
||||
});
|
||||
|
|
|
@ -15,7 +15,8 @@ serve({
|
|||
TypeChildContainerDefault: 'Trou',
|
||||
BorderWidth: 48,
|
||||
MinWidth: 500,
|
||||
MaxWidth: 3000
|
||||
MaxWidth: 3000,
|
||||
Width: 500
|
||||
}
|
||||
],
|
||||
AvailableSymbols: [],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue