fix(button): add button-disabled class when disabled attribute is on button

closes #741
This commit is contained in:
Brandy Carney
2015-12-14 14:00:20 -05:00
parent 44508a3234
commit 41fac64256
2 changed files with 7 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ button {
}
// Re-set default cursor for disabled elements.
button[disabled],
.button-disabled,
html input[disabled] {
cursor: default;
}

View File

@@ -14,6 +14,7 @@ import {Toolbar} from '../toolbar/toolbar';
* @property [full] - for a full width button
* @property [small] - sets button size to small
* @property [large] - sets button size to large
* @property [disabled] - disables the button
* @property [fab] - for a floating action button
* @property [fab-left] - position a fab button to the left
* @property [fab-right] - position a fab button to the right
@@ -43,6 +44,7 @@ export class Button {
this._display = null; // block/full
this._colors = []; // primary/secondary
this._icon = null; // left/right/only
this._disabled = false; // disabled
let element = elementRef.nativeElement;
@@ -56,6 +58,10 @@ export class Button {
return;
}
if (element.hasAttribute('disabled')) {
this._disabled = true;
}
this._readAttrs(element);
this._readIcon(element);
}