Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(input): change dividerColor to color #3726

Merged
merged 2 commits into from
Mar 27, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/demo-app/input/input-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h4>Textarea</h4>
</p>
<p>
<md-checkbox [(ngModel)]="dividerColor">Check to change the divider color:</md-checkbox>
<md-input-container [dividerColor]="dividerColor ? 'primary' : 'accent'">
<md-input-container [color]="dividerColor ? 'primary' : 'accent'">
<input mdInput [placeholder]="dividerColor ? 'Primary color' : 'Accent color'">
</md-input-container>
</p>
Expand Down
8 changes: 4 additions & 4 deletions src/lib/input/input-container.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
[attr.for]="_mdInputChild.id"
[class.mat-empty]="_mdInputChild.empty && !_shouldAlwaysFloat"
[class.mat-float]="_canPlaceholderFloat"
[class.mat-accent]="dividerColor == 'accent'"
[class.mat-warn]="dividerColor == 'warn'"
[class.mat-accent]="color == 'accent'"
[class.mat-warn]="color == 'warn'"
*ngIf="_hasPlaceholder()">
<ng-content select="md-placeholder, mat-placeholder"></ng-content>
{{_mdInputChild.placeholder}}
Expand All @@ -32,8 +32,8 @@
<div class="mat-input-underline"
[class.mat-disabled]="_mdInputChild.disabled">
<span class="mat-input-ripple"
[class.mat-accent]="dividerColor == 'accent'"
[class.mat-warn]="dividerColor == 'warn'"></span>
[class.mat-accent]="color == 'accent'"
[class.mat-warn]="color == 'warn'"></span>
</div>

<div *ngIf="hintLabel != ''" [attr.id]="_hintLabelId" class="mat-hint">{{hintLabel}}</div>
Expand Down
7 changes: 6 additions & 1 deletion src/lib/input/input-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,12 @@ export class MdInputContainer implements AfterContentInit {
@Input() align: 'start' | 'end' = 'start';

/** Color of the input divider, based on the theme. */
@Input() dividerColor: 'primary' | 'accent' | 'warn' = 'primary';
@Input() color: 'primary' | 'accent' | 'warn' = 'primary';

/** @deprecated Use color instead. */
@Input()
get dividerColor() { return this.color; }
set dividerColor(value) { this.color = value; }

/** Whether the floating label should always float or not. */
get _shouldAlwaysFloat() { return this._floatPlaceholder === 'always'; };
Expand Down