Skip to content

Commit

Permalink
feat(button): add isIconButton and isRoundButton properties (#11226)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther authored and jelbourn committed May 10, 2018
1 parent c936bc9 commit 318d699
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/lib/button/button.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<span class="mat-button-wrapper"><ng-content></ng-content></span>
<div matRipple class="mat-button-ripple"
[class.mat-button-ripple-round]="_isRoundButton || _isIconButton"
[class.mat-button-ripple-round]="isRoundButton || isIconButton"
[matRippleDisabled]="_isRippleDisabled()"
[matRippleCentered]="_isIconButton"
[matRippleCentered]="isIconButton"
[matRippleTrigger]="_getHostElement()"></div>
<div class="mat-button-focus-overlay"></div>
6 changes: 3 additions & 3 deletions src/lib/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ export class MatButton extends _MatButtonMixinBase
implements OnDestroy, CanDisable, CanColor, CanDisableRipple {

/** Whether the button is round. */
_isRoundButton: boolean = this._hasHostAttributes('mat-fab', 'mat-mini-fab');
readonly isRoundButton: boolean = this._hasHostAttributes('mat-fab', 'mat-mini-fab');

/** Whether the button is icon button. */
_isIconButton: boolean = this._hasHostAttributes('mat-icon-button');
readonly isIconButton: boolean = this._hasHostAttributes('mat-icon-button');

/** Reference to the MatRipple instance of the button. */
@ViewChild(MatRipple) ripple: MatRipple;
Expand All @@ -104,7 +104,7 @@ export class MatButton extends _MatButtonMixinBase

this._focusMonitor.monitor(this._elementRef.nativeElement, true);

if (this._isRoundButton) {
if (this.isRoundButton) {
this.color = DEFAULT_ROUND_BUTTON_COLOR;
} else if (this._hasHostAttributes('mat-flat-button')) {
this.color = DEFAULT_FLAT_BUTTON_COLOR;
Expand Down

0 comments on commit 318d699

Please sign in to comment.