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);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
isSidebarOpen: true,
|
isSidebarOpen: true,
|
||||||
isSVGSidebarOpen: true,
|
isSVGSidebarOpen: false,
|
||||||
configuration: {
|
configuration: {
|
||||||
AvailableContainers: [],
|
AvailableContainers: [],
|
||||||
AvailableSymbols: [],
|
AvailableSymbols: [],
|
||||||
|
@ -69,11 +69,17 @@ class App extends React.Component<IAppProps> {
|
||||||
return;
|
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({
|
const container = new Container({
|
||||||
id: this.state.MainContainer.props.children.length.toString(),
|
id: this.state.MainContainer.props.children.length.toString(),
|
||||||
x: 0,
|
x: 0 + properties?.Width * this.state.MainContainer.props.children.length,
|
||||||
y: 0,
|
y: 0,
|
||||||
width: 300,
|
width: properties?.Width,
|
||||||
height: this.state.configuration.MainContainer.Height,
|
height: this.state.configuration.MainContainer.Height,
|
||||||
children: []
|
children: []
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,8 @@ serve({
|
||||||
TypeChildContainerDefault: 'Trou',
|
TypeChildContainerDefault: 'Trou',
|
||||||
BorderWidth: 48,
|
BorderWidth: 48,
|
||||||
MinWidth: 500,
|
MinWidth: 500,
|
||||||
MaxWidth: 3000
|
MaxWidth: 3000,
|
||||||
|
Width: 500
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
AvailableSymbols: [],
|
AvailableSymbols: [],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue