fix(button): corrected issue with colors required for styles.

This commit is contained in:
Josh Thomas
2017-05-02 16:08:02 -05:00
parent 1d02f64c91
commit 9788974d4c

View File

@ -182,10 +182,7 @@ export class Button {
/** /**
* @hidden * @hidden
*/ */
getColorClassList(color: string, role: string, style: string, mode: string): string | null { getColorClassList(color: string, role: string, style: string, mode: string): string[] {
if (!color) {
return null;
}
style = (role !== 'bar-button' && style === 'solid') ? 'default' : style; style = (role !== 'bar-button' && style === 'solid') ? 'default' : style;
let className = let className =
role + role +
@ -193,16 +190,13 @@ export class Button {
'-' + style.toLowerCase() : '-' + style.toLowerCase() :
''); '');
console.log(role, style, className, mode, color); return [].concat(
`${className}-${mode}`,
return `${className}-${mode}-${color}`; color ? `${className}-${mode}-${color}` : []
);
} }
getStyleClassList(role: string): string[] { getStyleClassList(role: string): string[] {
if (!this.color) {
return [];
}
var classList = [].concat( var classList = [].concat(
this.outline ? this.getColorClassList(this.color, role, 'outline', this.mode) : [], this.outline ? this.getColorClassList(this.color, role, 'outline', this.mode) : [],
this.clear ? this.getColorClassList(this.color, role, 'clear', this.mode) : [], this.clear ? this.getColorClassList(this.color, role, 'clear', this.mode) : [],