Skip to content

Commit

Permalink
fix(component): updated component
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Jan 30, 2017
1 parent 194eab7 commit 94ad8b6
Show file tree
Hide file tree
Showing 5 changed files with 785 additions and 53 deletions.
5 changes: 4 additions & 1 deletion src/star-rating-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class StarRatingConfig implements IStarRatingCompBindings {

assetsPath: string = "assets/images/";


svgPath: string = this.assetsPath + "star-rating.icons.svg";
svgEmptySymbolId: string = "star-empty";
svgHalfSymbolId: string = "star-half";
Expand All @@ -45,6 +46,8 @@ export class StarRatingConfig implements IStarRatingCompBindings {

svgPathFilled: string = this.svgPath + "#" + this.svgFilledSymbolId;

getColor:(rating: number, numOfStars: number, staticColor?: starRatingColors) => starRatingColors;
/*
getColor(rating: number, numOfStars: number, staticColor?: starRatingColors): starRatingColors {
rating = rating || 0;
Expand All @@ -70,7 +73,7 @@ export class StarRatingConfig implements IStarRatingCompBindings {
return color;
}

*/
getHalfStarVisible(rating: number): boolean {
return Math.abs(rating % 1) > 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/star-rating-struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export interface IStarRatingCompBindings {
getColor?(rating: number, numOfStars: number, staticColor?: starRatingColors): starRatingColors;
//Outputs (& bindings)
onClick?: ($event: any) => IStarRatingOnClickEvent;
onUpdate?: ($event: any) => IStarRatingOnUpdateEvent;
onUpdate?: ($event: any) => IStarRatingOnRatingChangeEvent;
}

export interface IStarRatingOnClickEvent {
rating: number;
}

export interface IStarRatingOnUpdateEvent {
export interface IStarRatingOnRatingChangeEvent {
rating: number;
}

0 comments on commit 94ad8b6

Please sign in to comment.