File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1287,8 +1287,8 @@ class ResizableSidebar extends React.Component<ResizableSidebarProps> {
12871287 startResizing ( event : React . MouseEvent < HTMLDivElement > ) {
12881288 event . preventDefault ( ) ;
12891289
1290- let { parentRef, position } = this . props ;
1291- let parentRect = parentRef . current ?. getBoundingClientRect ( ) ;
1290+ const { parentRef, position } = this . props ;
1291+ const parentRect = parentRef . current ?. getBoundingClientRect ( ) ;
12921292
12931293 if ( ! parentRect ) return ;
12941294
@@ -1298,15 +1298,17 @@ class ResizableSidebar extends React.Component<ResizableSidebarProps> {
12981298 this . startX = event . clientX - parentRect . left ;
12991299 }
13001300
1301- this . resizeStartWidth = GlobalModel . mainSidebarModel . getWidth ( ) ;
1301+ const mainSidebarModel = GlobalModel . mainSidebarModel ;
1302+ const collapsed = mainSidebarModel . getCollapsed ( ) ;
1303+
1304+ this . resizeStartWidth = collapsed ? MagicLayout . MainSidebarMinWidth : mainSidebarModel . getWidth ( ) ;
13021305 document . addEventListener ( "mousemove" , this . onMouseMove ) ;
13031306 document . addEventListener ( "mouseup" , this . stopResizing ) ;
13041307
13051308 document . body . style . cursor = "col-resize" ;
13061309 mobx . action ( ( ) => {
1307- const sbm = GlobalModel . mainSidebarModel ;
1308- sbm . setTempWidthAndTempCollapsed ( this . resizeStartWidth , sbm . getCollapsed ( ) ) ;
1309- sbm . isDragging . set ( true ) ;
1310+ mainSidebarModel . setTempWidthAndTempCollapsed ( this . resizeStartWidth , collapsed ) ;
1311+ mainSidebarModel . isDragging . set ( true ) ;
13101312 } ) ( ) ;
13111313 }
13121314
You can’t perform that action at this time.
0 commit comments