Skip to content

Commit

Permalink
refactor(igx-combo): remove bind, move prop #3243
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipata committed Dec 4, 2018
1 parent 0c48a10 commit e7f8808
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export class IgxComboDropDownComponent extends IgxDropDownBase implements AfterV
super(elementRef, cdr, selection);
}

/**
* @hidden
*/
private _vScrollListener = null;

/**
* @hidden
*/
Expand All @@ -57,6 +52,12 @@ export class IgxComboDropDownComponent extends IgxDropDownBase implements AfterV
this.items.length - 1;
}

/**
* @hidden
* @internal
*/
public disableTransitions = false;

/**
* Event emitter overrides
*
Expand Down Expand Up @@ -340,7 +341,7 @@ export class IgxComboDropDownComponent extends IgxDropDownBase implements AfterV
/**
* @hidden
*/
protected verticalScrollHandler(event) {
protected scrollHandler: () => void = () => {
this.disableTransitions = true;
}

Expand Down Expand Up @@ -391,15 +392,14 @@ export class IgxComboDropDownComponent extends IgxDropDownBase implements AfterV
}

public ngAfterViewInit() {
this._vScrollListener = this.verticalScrollHandler.bind(this);
this.verticalScrollContainer.getVerticalScroll().addEventListener('scroll', this._vScrollListener);
this.verticalScrollContainer.getVerticalScroll().addEventListener('scroll', this.scrollHandler);
}

/**
*@hidden
*/
public ngOnDestroy(): void {
this.verticalScrollContainer.getVerticalScroll().removeEventListener('scroll', this._vScrollListener);
this.verticalScrollContainer.getVerticalScroll().removeEventListener('scroll', this.scrollHandler);
this.destroy$.next(true);
this.destroy$.complete();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import {
Input
} from '@angular/core';
import { IgxSelectionAPIService } from '../core/selection';
import { IgxDropDownBase, IgxDropDownItemBase } from '../drop-down/drop-down.base';
import { IgxDropDownItemBase } from '../drop-down/drop-down.base';
import { IGX_COMBO_COMPONENT, IgxComboBase } from './combo.common';
import { IgxComboDropDownComponent } from './combo-dropdown.component';

/** @hidden */
@Component({
Expand All @@ -35,7 +36,7 @@ export class IgxComboItemComponent extends IgxDropDownItemBase {

constructor(
@Inject(IGX_COMBO_COMPONENT) private combo: IgxComboBase,
public dropDown: IgxDropDownBase,
public dropDown: IgxComboDropDownComponent,
protected elementRef: ElementRef,
protected selection: IgxSelectionAPIService
) {
Expand Down
5 changes: 0 additions & 5 deletions projects/igniteui-angular/src/lib/drop-down/drop-down.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,6 @@ export abstract class IgxDropDownBase implements OnInit, IToggleView {
return this.elementRef.nativeElement;
}

/**
* @hidden
*/
public disableTransitions = false;

/**
* Get dropdown's html element of it scroll container
*/
Expand Down

0 comments on commit e7f8808

Please sign in to comment.