mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-04 18:59:08 +01:00
Fix broken merge (#266)
This commit is contained in:
parent
37ab1bca90
commit
da69a0f583
@ -2630,7 +2630,7 @@ class MainSidebarModel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setTempWidthAndTempCollapsed(newWidth: number, newCollapsed: boolean): void {
|
setTempWidthAndTempCollapsed(newWidth: number, newCollapsed: boolean): void {
|
||||||
let width = Math.max(MagicLayout.MainSidebarMinWidth, Math.min(newWidth, MagicLayout.MainSidebarMaxWidth));
|
const width = Math.max(MagicLayout.MainSidebarMinWidth, Math.min(newWidth, MagicLayout.MainSidebarMaxWidth));
|
||||||
|
|
||||||
mobx.action(() => {
|
mobx.action(() => {
|
||||||
this.tempWidth.set(width);
|
this.tempWidth.set(width);
|
||||||
@ -2639,8 +2639,8 @@ class MainSidebarModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getWidth(): number {
|
getWidth(): number {
|
||||||
let clientData = GlobalModel.clientData.get();
|
const clientData = GlobalModel.clientData.get();
|
||||||
let width = clientData.clientopts.mainsidebar.width;
|
let width = clientData?.clientopts?.mainsidebar?.width ?? MagicLayout.MainSidebarDefaultWidth;
|
||||||
if (this.isDragging.get()) {
|
if (this.isDragging.get()) {
|
||||||
if (this.tempWidth.get() == null && width == null) {
|
if (this.tempWidth.get() == null && width == null) {
|
||||||
return MagicLayout.MainSidebarDefaultWidth;
|
return MagicLayout.MainSidebarDefaultWidth;
|
||||||
@ -2660,7 +2660,7 @@ class MainSidebarModel {
|
|||||||
if (width <= MagicLayout.MainSidebarMinWidth) {
|
if (width <= MagicLayout.MainSidebarMinWidth) {
|
||||||
width = MagicLayout.MainSidebarDefaultWidth;
|
width = MagicLayout.MainSidebarDefaultWidth;
|
||||||
}
|
}
|
||||||
let snapPoint = MagicLayout.MainSidebarMinWidth + MagicLayout.MainSidebarSnapThreshold;
|
const snapPoint = MagicLayout.MainSidebarMinWidth + MagicLayout.MainSidebarSnapThreshold;
|
||||||
if (width < snapPoint || width > MagicLayout.MainSidebarMaxWidth) {
|
if (width < snapPoint || width > MagicLayout.MainSidebarMaxWidth) {
|
||||||
width = MagicLayout.MainSidebarDefaultWidth;
|
width = MagicLayout.MainSidebarDefaultWidth;
|
||||||
}
|
}
|
||||||
@ -2672,8 +2672,8 @@ class MainSidebarModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCollapsed(): boolean {
|
getCollapsed(): boolean {
|
||||||
let clientData = GlobalModel.clientData.get();
|
const clientData = GlobalModel.clientData.get();
|
||||||
let collapsed = clientData.clientopts.mainsidebar.collapsed;
|
const collapsed = clientData?.clientopts?.mainsidebar?.collapsed;
|
||||||
if (this.isDragging.get()) {
|
if (this.isDragging.get()) {
|
||||||
if (this.tempCollapsed.get() == null && collapsed == null) {
|
if (this.tempCollapsed.get() == null && collapsed == null) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user