Skip to content

Commit

Permalink
fix(masteries): revert refactor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed Mar 28, 2016
1 parent 4ff7f38 commit e65c28f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/app/build/mastery-category.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export class MasteryCategoryComponent implements OnInit {
this.forTier(tier.index - 1, (t) => t.lock());
}
if (tier.getRank() > mastery.getRank()) {
mastery.setRank(mastery.getMaxRank() - mastery.getRank());
tier.setOtherRank(mastery, mastery.getMaxRank() - mastery.getRank());
}
var deviation = this.getTotalRankDeviation();
if (deviation) {
if (tier.getRank() > mastery.getRank()) {
mastery.setRank(tier.getRank() - deviation - mastery.getRank());
tier.setOtherRank(mastery, tier.getRank() - deviation - mastery.getRank());
} else {
mastery.setRank(tier.getRank() - deviation);
}
Expand Down
7 changes: 7 additions & 0 deletions src/app/build/mastery-tier.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ export class MasteryTierComponent implements OnInit {
this.forEachMastery((m) => m.unlock());
}

public setOtherRank(mastery: MasteryComponent, rank: number) {
this.masteries.forEach(function(m: MasteryComponent) {
if (mastery !== m) {
m.setRank(rank);
}
});
}
public getRank(): number {
var rank = 0;
this.forEachMastery((m) => rank += m.getRank());
Expand Down
2 changes: 1 addition & 1 deletion src/app/build/mastery.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Colors {
selector: 'mastery',
directives: [NgIf, NgClass, DDragonDirective],
template: `
<div *ngIf="data" [ngClass]="{disabled: disabled, active: active}" (click)="clicked()" (contextmenu)="rightClicked()" (dragend)="dragEnd()">
<div *ngIf="data" [ngClass]="{enabled: enabled, active: active}" (click)="clicked()" (contextmenu)="rightClicked()" (dragend)="dragEnd()">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" *ngIf="data.ranks > 1" class="rank" width="30" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient cy="10%" fy="0%" id="radialGradient">
Expand Down
6 changes: 3 additions & 3 deletions src/assets/css/build.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ mastery > div:before {
z-index: 10;
}

mastery > div:not(.disabled):before {
mastery > div.enabled:before {
border: 2px solid #356BB0;
}

mastery > div:not(.disabled) {
mastery > div.enabled {
cursor: pointer;
}

Expand All @@ -168,7 +168,7 @@ mastery .rank {
z-index: 20;
}

mastery > div.disabled .rank {
mastery > div:not(.enabled) .rank {
cursor: default;
}

Expand Down

0 comments on commit e65c28f

Please sign in to comment.