Skip to content

Commit

Permalink
[Web] Fix web layout (DataLinkDC#2646)
Browse files Browse the repository at this point in the history
* fix web layout

* fix web layout
  • Loading branch information
zackyoungh authored Dec 14, 2023
1 parent 0ad873e commit 7062163
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions dinky-web/src/pages/DataStudio/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,15 @@ const Model: ModelType = {
) {
centerContentHeight = state.centerContentHeight;
toolContentHeight = state.toolContentHeight;
} else {
centerContentHeight = state.centerContentHeight - (state.bottomContainer.height as number);
toolContentHeight = state.toolContentHeight - (state.bottomContainer.height as number);
}
else {
if (state.centerContentHeight>state.bottomContainer.height){
centerContentHeight = state.centerContentHeight - (state.bottomContainer.height as number);
toolContentHeight = state.toolContentHeight - (state.bottomContainer.height as number);
}else {
centerContentHeight = state.centerContentHeight;
toolContentHeight = state.toolContentHeight;
}
}

return {
Expand Down Expand Up @@ -671,6 +677,7 @@ const Model: ModelType = {
for (const [index, pane] of panes.entries()) {
if (pane.key === needCloseKey) {
const nextPane = panes[(index + 1) % panes.length];
const height = document.documentElement.clientHeight - VIEW.headerHeight - VIEW.headerNavHeight - VIEW.footerHeight - VIEW.otherHeight;
return {
...state,
tabs: {
Expand All @@ -684,7 +691,9 @@ const Model: ModelType = {
footContainer: {
...state.footContainer,
...getFooterValue(panes, nextPane.key)
}
},
toolContentHeight: panes.length < 2? height-VIEW.leftMargin : state.toolContentHeight,
centerContentHeight: panes.length < 2? height : state.toolContentHeight,
};
}
}
Expand Down

0 comments on commit 7062163

Please sign in to comment.