66import 'vs/css!./media/panelpart' ;
77import { TPromise } from 'vs/base/common/winjs.base' ;
88import { IAction } from 'vs/base/common/actions' ;
9- import { Event } from 'vs/base/common/event' ;
9+ import { Event , mapEvent } from 'vs/base/common/event' ;
1010import { Registry } from 'vs/platform/registry/common/platform' ;
1111import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar' ;
1212import { IPanel } from 'vs/workbench/common/panel' ;
@@ -119,13 +119,13 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
119119 }
120120
121121 private registerListeners ( ) : void {
122- this . _register ( this . onDidPanelOpen ( this . _onDidPanelOpen , this ) ) ;
122+ this . _register ( this . onDidPanelOpen ( ( { panel } ) => this . _onDidPanelOpen ( panel ) ) ) ;
123123 this . _register ( this . onDidPanelClose ( this . _onDidPanelClose , this ) ) ;
124124
125125 this . _register ( this . registry . onDidRegister ( panelDescriptor => this . compositeBar . addComposite ( panelDescriptor ) ) ) ;
126126
127127 // Activate panel action on opening of a panel
128- this . _register ( this . onDidPanelOpen ( panel => {
128+ this . _register ( this . onDidPanelOpen ( ( { panel } ) => {
129129 this . compositeBar . activateComposite ( panel . getId ( ) ) ;
130130 this . layoutCompositeBar ( ) ; // Need to relayout composite bar since different panels have different action bar width
131131 } ) ) ;
@@ -146,8 +146,8 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
146146 }
147147 }
148148
149- get onDidPanelOpen ( ) : Event < IPanel > {
150- return this . _onDidCompositeOpen . event ;
149+ get onDidPanelOpen ( ) : Event < { panel : IPanel , focus : boolean } > {
150+ return mapEvent ( this . _onDidCompositeOpen . event , compositeOpen => ( { panel : compositeOpen . composite , focus : compositeOpen . focus } ) ) ;
151151 }
152152
153153 get onDidPanelClose ( ) : Event < IPanel > {
0 commit comments