@@ -231,7 +231,6 @@ function isInputElement(e: HTMLElement): boolean {
231231class KeyboardController < T > implements IDisposable {
232232
233233 private readonly disposables = new DisposableStore ( ) ;
234- private openController : IOpenController ;
235234
236235 constructor (
237236 private list : List < T > ,
@@ -240,8 +239,6 @@ class KeyboardController<T> implements IDisposable {
240239 ) {
241240 const multipleSelectionSupport = options . multipleSelectionSupport !== false ;
242241
243- this . openController = options . openController || DefaultOpenController ;
244-
245242 const onKeyDown = Event . chain ( domEvent ( view . domNode , 'keydown' ) )
246243 . filter ( e => ! isInputElement ( e . target as HTMLElement ) )
247244 . map ( e => new StandardKeyboardEvent ( e ) ) ;
@@ -262,10 +259,6 @@ class KeyboardController<T> implements IDisposable {
262259 e . preventDefault ( ) ;
263260 e . stopPropagation ( ) ;
264261 this . list . setSelection ( this . list . getFocus ( ) , e . browserEvent ) ;
265-
266- if ( this . openController . shouldOpen ( e . browserEvent ) ) {
267- this . list . open ( this . list . getFocus ( ) , e . browserEvent ) ;
268- }
269262 }
270263
271264 private onUpArrow ( e : StandardKeyboardEvent ) : void {
@@ -527,21 +520,10 @@ const DefaultMultipleSelectionController = {
527520 isSelectionRangeChangeEvent
528521} ;
529522
530- const DefaultOpenController : IOpenController = {
531- shouldOpen : ( event : UIEvent ) => {
532- if ( event instanceof MouseEvent ) {
533- return ! isMouseRightClick ( event ) ;
534- }
535-
536- return true ;
537- }
538- } ;
539-
540523export class MouseController < T > implements IDisposable {
541524
542525 private multipleSelectionSupport : boolean ;
543526 readonly multipleSelectionController : IMultipleSelectionController < T > | undefined ;
544- private openController : IOpenController ;
545527 private mouseSupport : boolean ;
546528 private readonly disposables = new DisposableStore ( ) ;
547529
@@ -552,7 +534,6 @@ export class MouseController<T> implements IDisposable {
552534 this . multipleSelectionController = list . options . multipleSelectionController || DefaultMultipleSelectionController ;
553535 }
554536
555- this . openController = list . options . openController || DefaultOpenController ;
556537 this . mouseSupport = typeof list . options . mouseSupport === 'undefined' || ! ! list . options . mouseSupport ;
557538
558539 if ( this . mouseSupport ) {
@@ -632,10 +613,6 @@ export class MouseController<T> implements IDisposable {
632613
633614 if ( ! isMouseRightClick ( e . browserEvent ) ) {
634615 this . list . setSelection ( [ focus ] , e . browserEvent ) ;
635-
636- if ( this . openController . shouldOpen ( e . browserEvent ) ) {
637- this . list . open ( [ focus ] , e . browserEvent ) ;
638- }
639616 }
640617 }
641618
@@ -650,7 +627,6 @@ export class MouseController<T> implements IDisposable {
650627
651628 const focus = this . list . getFocus ( ) ;
652629 this . list . setSelection ( focus , e . browserEvent ) ;
653- this . list . pin ( focus ) ;
654630 }
655631
656632 private changeSelection ( e : IListMouseEvent < T > | IListTouchEvent < T > , reference : number | undefined ) : void {
@@ -694,10 +670,6 @@ export interface IMultipleSelectionController<T> {
694670 isSelectionRangeChangeEvent ( event : IListMouseEvent < T > | IListTouchEvent < T > ) : boolean ;
695671}
696672
697- export interface IOpenController {
698- shouldOpen ( event : UIEvent ) : boolean ;
699- }
700-
701673export interface IStyleController {
702674 style ( styles : IListStyles ) : void ;
703675}
@@ -841,7 +813,6 @@ export interface IListOptions<T> {
841813 readonly keyboardSupport ?: boolean ;
842814 readonly multipleSelectionSupport ?: boolean ;
843815 readonly multipleSelectionController ?: IMultipleSelectionController < T > ;
844- readonly openController ?: IOpenController ;
845816 readonly styleController ?: ( suffix : string ) => IStyleController ;
846817 readonly accessibilityProvider ?: IListAccessibilityProvider < T > ;
847818
@@ -1134,12 +1105,6 @@ export class List<T> implements ISpliceable<T>, IDisposable {
11341105 return Event . map ( this . eventBufferer . wrapEvent ( this . selection . onChange ) , e => this . toListEvent ( e ) ) ;
11351106 }
11361107
1137- private readonly _onDidOpen = new Emitter < IListEvent < T > > ( ) ;
1138- readonly onDidOpen : Event < IListEvent < T > > = this . _onDidOpen . event ;
1139-
1140- private readonly _onDidPin = new Emitter < IListEvent < T > > ( ) ;
1141- readonly onDidPin : Event < IListEvent < T > > = this . _onDidPin . event ;
1142-
11431108 get domId ( ) : string { return this . view . domId ; }
11441109 get onDidScroll ( ) : Event < ScrollEvent > { return this . view . onDidScroll ; }
11451110 get onMouseClick ( ) : Event < IListMouseEvent < T > > { return this . view . onMouseClick ; }
@@ -1625,26 +1590,6 @@ export class List<T> implements ISpliceable<T>, IDisposable {
16251590 return this . view . domNode ;
16261591 }
16271592
1628- open ( indexes : number [ ] , browserEvent ?: UIEvent ) : void {
1629- for ( const index of indexes ) {
1630- if ( index < 0 || index >= this . length ) {
1631- throw new ListError ( this . user , `Invalid index ${ index } ` ) ;
1632- }
1633- }
1634-
1635- this . _onDidOpen . fire ( { indexes, elements : indexes . map ( i => this . view . element ( i ) ) , browserEvent } ) ;
1636- }
1637-
1638- pin ( indexes : number [ ] , browserEvent ?: UIEvent ) : void {
1639- for ( const index of indexes ) {
1640- if ( index < 0 || index >= this . length ) {
1641- throw new ListError ( this . user , `Invalid index ${ index } ` ) ;
1642- }
1643- }
1644-
1645- this . _onDidPin . fire ( { indexes, elements : indexes . map ( i => this . view . element ( i ) ) , browserEvent } ) ;
1646- }
1647-
16481593 style ( styles : IListStyles ) : void {
16491594 this . styleController . style ( styles ) ;
16501595 }
@@ -1687,8 +1632,6 @@ export class List<T> implements ISpliceable<T>, IDisposable {
16871632 this . _onDidDispose . fire ( ) ;
16881633 this . disposables . dispose ( ) ;
16891634
1690- this . _onDidOpen . dispose ( ) ;
1691- this . _onDidPin . dispose ( ) ;
16921635 this . _onDidDispose . dispose ( ) ;
16931636 }
16941637}
0 commit comments