Skip to content

Commit 0c6634a

Browse files
committed
Allow background color to be set back to undefined
1 parent 354ed00 commit 0c6634a

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/lib/tabs/tab-group.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ export class MdTabGroup extends _MdTabGroupMixinBase implements CanColor {
106106
@Input()
107107
get background(): ThemePalette { return this._background; }
108108
set background(value: ThemePalette) {
109-
if (value) {
110-
let nativeElement = this._elementRef.nativeElement;
109+
let nativeElement = this._elementRef.nativeElement;
110+
111+
this._renderer.removeClass(nativeElement, `mat-background-${this.background}`);
111112

112-
this._renderer.removeClass(nativeElement, `mat-background-${this.background}`);
113+
if (value) {
113114
this._renderer.addClass(nativeElement, `mat-background-${value}`);
114-
this._background = value;
115115
}
116+
117+
this._background = value;
116118
}
117119
private _background: ThemePalette;
118120

src/lib/tabs/tab-nav-bar/tab-nav-bar.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ export class MdTabNav extends _MdTabNavMixinBase implements AfterContentInit, Ca
6464
@Input()
6565
get background(): ThemePalette { return this._background; }
6666
set background(value: ThemePalette) {
67-
if (value) {
68-
let nativeElement = this._elementRef.nativeElement;
67+
let nativeElement = this._elementRef.nativeElement;
68+
69+
this._renderer.removeClass(nativeElement, `mat-background-${this.background}`);
6970

70-
this._renderer.removeClass(nativeElement, `mat-background-${this.background}`);
71+
if (value) {
7172
this._renderer.addClass(nativeElement, `mat-background-${value}`);
72-
this._background = value;
7373
}
74+
75+
this._background = value;
7476
}
7577
private _background: ThemePalette;
7678

0 commit comments

Comments
 (0)