Skip to content

Commit

Permalink
fix(progress): Progress now honours manual addition of success class
Browse files Browse the repository at this point in the history
Closes #100
  • Loading branch information
edcarroll committed Jun 7, 2017
1 parent 5f125a5 commit b4c7249
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/progress/progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class SuiProgress {
private _maximum:number;
private _precision:number;

private _overrideSuccess:boolean;

@Input()
public autoSuccess:boolean;

Expand Down Expand Up @@ -81,7 +83,7 @@ export class SuiProgress {

@HostBinding('class.success')
private get reachedMaximum() {
return (this.value >= this.maximum) && this.autoSuccess;
return this._overrideSuccess || ((this.value >= this.maximum) && this.autoSuccess);
}

@HostBinding('attr.data-percent')
Expand All @@ -98,13 +100,17 @@ export class SuiProgress {
if (classes.includes("attached") || classes.includes("tiny")) {
this.showProgress = false;
}
if (classes.includes("success")) {
this._overrideSuccess = true;
}
}

constructor() {
this.value = 0;
this.maximum = 100;
this.precision = 0;

this._overrideSuccess = false;
this.autoSuccess = true;
this.showProgress = true;

Expand Down

0 comments on commit b4c7249

Please sign in to comment.