Skip to content

Commit

Permalink
Clear up some confusion caused by AngularJS number filter
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreCat committed Jan 5, 2014
1 parent 7cfca80 commit 7904b8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions public/js/controllers/headerCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User',
function($scope, Groups, User) {

$scope.Math = window.Math;

$scope.party = Groups.party(function(){
$scope.partyMinusSelf = _.sortBy(
Expand Down
6 changes: 3 additions & 3 deletions views/shared/header/header.jade
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
.bar(style='width: {{Shared.percent(user.stats.hp, 50)}}%;')
span.meter-text
i.icon-heart
| {{user.stats.hp | number:0}} / 50
| {{Math.ceil(user.stats.hp)}} / 50
.meter.experience(title='Experience')
.bar(style='width: {{Shared.percent(user.stats.exp,Shared.tnl(user.stats.lvl))}}%;')
span.meter-text
i.icon-star
| {{user.stats.exp | number:0}} / {{Shared.tnl(user.stats.lvl) | number:0}}
| {{Math.floor(user.stats.exp)}} / {{Shared.tnl(user.stats.lvl) | number:0}}
// FIXME doesn't look great here, but the "Experience" CSS title rollover covers it where it was before
span(ng-show='user.history.exp')
a(ng-click='toggleChart("exp")', tooltip='Progress')
Expand All @@ -28,7 +28,7 @@
.bar(style='width: {{user.stats.mp / user._statsComputed.maxMP * 100}}%;')
span.meter-text
i.icon-fire
| {{user.stats.mp || 0 | number:0}} / {{user._statsComputed.maxMP}}
| {{Math.floor(user.stats.mp)}} / {{user._statsComputed.maxMP}}

// party
span(ng-controller='PartyCtrl')
Expand Down

0 comments on commit 7904b8e

Please sign in to comment.