@@ -82,6 +82,7 @@ class PanelManager {
8282 // and PanelEvent.CLOSED for cleanup (delete links, add panel to closed panels list, etc)
8383 this . handleUnmount = this . handleUnmount . bind ( this ) ;
8484 this . handleReopen = this . handleReopen . bind ( this ) ;
85+ this . handleReopenLast = this . handleReopenLast . bind ( this ) ;
8586 this . handleDeleted = this . handleDeleted . bind ( this ) ;
8687 this . handleClosed = this . handleClosed . bind ( this ) ;
8788 this . handleControlClose = this . handleControlClose . bind ( this ) ;
@@ -106,6 +107,7 @@ class PanelManager {
106107 eventHub . on ( PanelEvent . MOUNT , this . handleMount ) ;
107108 eventHub . on ( PanelEvent . UNMOUNT , this . handleUnmount ) ;
108109 eventHub . on ( PanelEvent . REOPEN , this . handleReopen ) ;
110+ eventHub . on ( PanelEvent . REOPEN_LAST , this . handleReopenLast ) ;
109111 eventHub . on ( PanelEvent . DELETE , this . handleDeleted ) ;
110112 eventHub . on ( PanelEvent . CLOSED , this . handleClosed ) ;
111113 eventHub . on ( PanelEvent . CLOSE , this . handleControlClose ) ;
@@ -118,6 +120,7 @@ class PanelManager {
118120 eventHub . off ( PanelEvent . MOUNT , this . handleMount ) ;
119121 eventHub . off ( PanelEvent . UNMOUNT , this . handleUnmount ) ;
120122 eventHub . off ( PanelEvent . REOPEN , this . handleReopen ) ;
123+ eventHub . off ( PanelEvent . REOPEN_LAST , this . handleReopenLast ) ;
121124 eventHub . off ( PanelEvent . DELETE , this . handleDeleted ) ;
122125 eventHub . off ( PanelEvent . CLOSED , this . handleClosed ) ;
123126 eventHub . off ( PanelEvent . CLOSE , this . handleControlClose ) ;
@@ -291,6 +294,11 @@ class PanelManager {
291294 LayoutUtils . openComponent ( { root, config, replaceConfig } ) ;
292295 }
293296
297+ handleReopenLast ( ) : void {
298+ if ( this . closed . length === 0 ) return ;
299+ this . handleReopen ( this . closed [ this . closed . length - 1 ] ) ;
300+ }
301+
294302 handleDeleted ( panelConfig : ClosedPanel ) : void {
295303 log . debug2 ( 'Deleted:' , panelConfig ) ;
296304
0 commit comments