Skip to content

Commit

Permalink
fix(list): rever list-item logic #4393
Browse files Browse the repository at this point in the history
  • Loading branch information
tachojelev committed Apr 8, 2019
1 parent b57b377 commit 3252cf0
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions projects/igniteui-angular/src/lib/list/list-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export class IgxListItemComponent implements IListChild {
* ```
* @memberof IgxListItemComponent
*/
@HostBinding('class.igx-list__header')
get headerStyle(): boolean {
return this.isHeader;
}
Expand All @@ -159,23 +160,11 @@ export class IgxListItemComponent implements IListChild {
* ```
* @memberof IgxListItemComponent
*/
@HostBinding('class.igx-list__item-base')
get innerStyle(): boolean {
return !this.isHeader;
}

/**
* Gets the currently applied class of the `list item` based on the display density of the `list`.
* ```typescript
* let hostClass = this.listItem.hostClass;
* ```
* @memberof IgxListItemComponent
*/
@HostBinding('attr.class')
get hostClass(): string {
const className = (this.isHeader) ? 'igx-list__header' : 'igx-list__item-base';
return this.getDensityClass(className);
}

/**
* Returns string value which describes the display mode of the `list item`.
* ```typescript
Expand Down Expand Up @@ -325,20 +314,6 @@ export class IgxListItemComponent implements IListChild {
}
}

/**
*@hidden
*/
private getDensityClass(baseStyleClass: string) {
switch (this.list.displayDensity) {
case DisplayDensity.cosy:
return `${baseStyleClass}--${DisplayDensity.cosy}`;
case DisplayDensity.compact:
return `${baseStyleClass}--${DisplayDensity.compact}`;
default:
return baseStyleClass;
}
}

/**
* Gets the `panState` of a `list item`.
* ```typescript
Expand Down

0 comments on commit 3252cf0

Please sign in to comment.