@@ -20,9 +20,9 @@ export interface ResizeDividerWidgetProps {
20
20
}
21
21
22
22
const isAligned = ( divider : ResizeDivision , aligned : Alignment , parent : WorkspaceNodeModel ) => {
23
- let beforeDirective = parent . getPanelDirective ( divider . before ) ;
24
- const afterDirective = parent . getPanelDirective ( divider . after ) ;
25
- if ( beforeDirective . expand !== afterDirective . expand ) {
23
+ let beforeDirective = parent . shouldChildExpand ( divider . before ) ;
24
+ const afterDirective = parent . shouldChildExpand ( divider . after ) ;
25
+ if ( beforeDirective !== afterDirective ) {
26
26
return false ;
27
27
}
28
28
let before = divider . before ;
@@ -31,8 +31,8 @@ const isAligned = (divider: ResizeDivision, aligned: Alignment, parent: Workspac
31
31
if ( ! before ) {
32
32
return true ;
33
33
}
34
- let beforeDirective = parent . getPanelDirective ( before ) ;
35
- if ( beforeDirective . expand ) {
34
+ let beforeDirective = parent . shouldChildExpand ( before ) ;
35
+ if ( beforeDirective ) {
36
36
return false ;
37
37
}
38
38
} while ( before ) ;
@@ -66,10 +66,6 @@ const getResizeStrategy = (
66
66
) : Pick < UseMouseDragDistanceProps , 'startMove' | 'moved' > => {
67
67
let sizeSnapshot = new Map < WorkspaceModel , number > ( ) ;
68
68
69
- const isExpand = ( model : WorkspaceModel ) => {
70
- return parent . getPanelDirective ( model ) . expand ;
71
- } ;
72
-
73
69
const setSize = ( model : WorkspaceModel , val : number ) => {
74
70
if ( divider . vertical ) {
75
71
model . setWidth ( val ) ;
@@ -96,12 +92,18 @@ const getResizeStrategy = (
96
92
let { before, after } = divider ;
97
93
98
94
// shrink|expand OR left aligned
99
- if ( ( ! isExpand ( before ) && isExpand ( after ) ) || isAligned ( divider , alignment , parent ) ) {
95
+ if (
96
+ ( ! parent . shouldChildExpand ( before ) && parent . shouldChildExpand ( after ) ) ||
97
+ isAligned ( divider , alignment , parent )
98
+ ) {
100
99
before = getAvailableElement ( before , alignment ) ;
101
100
setSize ( before , sizeSnapshot . get ( before ) + distance ) ;
102
101
}
103
102
// expand|shrink OR right aligned
104
- if ( ( isExpand ( before ) && ! isExpand ( after ) ) || ! isAligned ( divider , alignment , parent ) ) {
103
+ if (
104
+ ( parent . shouldChildExpand ( before ) && ! parent . shouldChildExpand ( after ) ) ||
105
+ ! isAligned ( divider , alignment , parent )
106
+ ) {
105
107
after = getAvailableElement ( after , getAlignmentInverted ( alignment ) ) ;
106
108
setSize ( after , sizeSnapshot . get ( after ) - distance ) ;
107
109
}
0 commit comments