@@ -515,9 +515,6 @@ const toggleFull = (group, actionContainer, maximize) => {
515515
516516const float = group => {
517517 if ( ! canFloat ( group ) ) return ;
518- if ( group . api . isMaximized ( ) ) {
519- toggleFull ( group , group . header . rightActionsContainer , true ) ;
520- }
521518 const dockview = group . api . accessor
522519 const width = dockview . width > 500 ? 500 : ( dockview . width - 10 )
523520 const height = dockview . height > 460 ? 460 : ( dockview . height - 10 )
@@ -612,18 +609,21 @@ const dock = (group, floatType) => {
612609 const originGroup = dockview . groups . find ( g => g . id . split ( '_' ) [ 0 ] == group . id . split ( '_' ) [ 0 ] && g . id != group . id )
613610 if ( ! originGroup ) return
614611 dockview . setVisible ( originGroup , true )
615- const { drawer } = group . getParams ( )
612+ originGroup . header . rightActionsContainer . classList . remove ( 'bb-maximize' )
613+ originGroup . element . parentElement . classList . remove ( 'bb-maximize' )
614+ const { drawer, rect = { } } = group . getParams ( )
616615 const inset = group . element . parentElement . style . inset . split ( ' ' ) . map ( item => isNaN ( parseFloat ( item ) ) ? item : parseFloat ( item ) )
617- const rect = {
618- width : group . width + 2 ,
619- height : group . height + 2 ,
620- position : { }
621- }
616+ if ( rect . isMaximized === false ) {
617+ rect . width = group . width + 2 ;
618+ rect . height = group . height + 2 ;
619+ rect . position = { } ;
622620 ; [ 'top' , 'right' , 'bottom' , 'left' ] . forEach ( ( key , index ) => {
623621 if ( typeof inset [ index ] == 'number' ) {
624622 rect . position [ key ] = inset [ index ]
625623 }
626624 } )
625+ }
626+ rect . isMaximized = false
627627 if ( floatType == 'drawer' ) {
628628 group . setParams ( { drawer : { ...drawer , width : rect . width } } )
629629 group . removePropsOfParams ( 'floatType' )
@@ -681,13 +681,14 @@ const floatingMaximize = group => {
681681 const rect = {
682682 width : group . width + 2 ,
683683 height : group . height + 2 ,
684+ isMaximized : true ,
684685 position : { }
685686 }
686- ; [ 'top' , 'right' , 'bottom' , 'left' ] . forEach ( ( key , index ) => {
687- if ( typeof inset [ index ] == 'number' ) {
688- rect . position [ key ] = inset [ index ]
689- }
690- } )
687+ ; [ 'top' , 'right' , 'bottom' , 'left' ] . forEach ( ( key , index ) => {
688+ if ( typeof inset [ index ] == 'number' ) {
689+ rect . position [ key ] = inset [ index ]
690+ }
691+ } )
691692 group . setParams ( { rect } )
692693
693694 parentEle . style . left = 0 ;
@@ -705,6 +706,7 @@ const floatingExitMaximized = group => {
705706 . map ( item => typeof item == 'number' ? ( item + 'px' ) : 'auto' ) . join ( ' ' )
706707 parentEle . style . width = `${ rect . width } px` ;
707708 parentEle . style . height = `${ rect . height } px` ;
709+ group . setParams ( { rect : { ...rect , isMaximized : false } } )
708710}
709711
710712const setWidth = ( observerList ) => {
0 commit comments