Skip to content

Commit

Permalink
fix: Add removed classes while changed on grid panel (#881)
Browse files Browse the repository at this point in the history
* fix: Add removed classes onChange on grid panel

* Remove Hostbinding classes
  • Loading branch information
jmarkowski authored and MattL75 committed Jun 13, 2019
1 parent bb1c224 commit e34ae8a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions library/src/lib/panel/panel-grid/panel-grid.component.ts
Expand Up @@ -12,17 +12,10 @@ import { AbstractFdNgxClass } from '../../utils/abstract-fd-ngx-class';
export class PanelGridComponent extends AbstractFdNgxClass {

/** Number of columns for the grid. */
@Input()
col: number;
@Input() col: number;

/** Whether the grid shoul have a gap. */
@Input()
@HostBinding('class.fd-panel-grid--nogap')
nogap: boolean = false;

/** @hidden */
@HostBinding('class.fd-panel-grid')
fdPanelGridClass: boolean = true;
/** Whether the grid should have a gap. */
@Input() nogap: boolean = false;

/** @hidden */
constructor(private elementRef: ElementRef) {
Expand All @@ -31,6 +24,12 @@ export class PanelGridComponent extends AbstractFdNgxClass {

/** @hidden */
_setProperties() {
this._addClassToElement('fd-panel-grid');

if (this.nogap) {
this._addClassToElement('fd-panel-grid--nogap');
}

if (this.col) {
this._addClassToElement('fd-panel-grid--' + this.col + 'col');
}
Expand Down

0 comments on commit e34ae8a

Please sign in to comment.