Skip to content

Commit 7e26e9f

Browse files
committed
Merge branch 'dev' into pr@dev@perf_revert_drawer
2 parents a0a7b18 + c062266 commit 7e26e9f

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/app/pages/main/main.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
class="content"
2828
id="right-side"
2929
[nzSize]="settingLayoutSize.rightWidth"
30+
[style.flex-grow]="settingLayoutSize.rightWidth === undefined ? 1 : null"
3031
>
3132
<div>
3233
<elements-content (toggleMenu)="onToggleMobileLayout()"></elements-content>

src/app/pages/main/main.component.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export class PageMainComponent implements OnInit {
1515
showIframeHider = false;
1616
showSubMenu: any = false;
1717
isDirectNavigation: boolean;
18-
settingLayoutSize = {
18+
settingLayoutSize: {
19+
leftWidth: string | number;
20+
rightWidth: string | number | undefined;
21+
} = {
1922
leftWidth: '20%',
2023
rightWidth: '80%'
2124
};
@@ -49,8 +52,14 @@ export class PageMainComponent implements OnInit {
4952
}
5053

5154
handleLayoutSettingChange(collapsed: boolean) {
52-
this.settingLayoutSize.leftWidth = collapsed ? '60' : '20%';
53-
this.settingLayoutSize.rightWidth = collapsed ? (window.innerWidth - 60).toString() : '80%';
55+
this.collapsed = collapsed;
56+
if (collapsed) {
57+
this.settingLayoutSize.leftWidth = 60;
58+
this.settingLayoutSize.rightWidth = undefined;
59+
} else {
60+
this.settingLayoutSize.leftWidth = '20%';
61+
this.settingLayoutSize.rightWidth = '80%';
62+
}
5463
}
5564

5665
onToggleMobileLayout() {}
@@ -100,7 +109,7 @@ export class PageMainComponent implements OnInit {
100109

101110
if (leftWidth < 100 && !this.collapsed) {
102111
leftWidth = 60;
103-
rightWidth = window.innerWidth - leftWidth;
112+
rightWidth = undefined;
104113
this.collapsed = true;
105114
} else if (leftWidth > 100 && this.collapsed) {
106115
leftWidth = '20%';

0 commit comments

Comments
 (0)