fix #2040 - $rootScope.moment = window.moment. Fixes to applying spell

This commit is contained in:
Tyler Renelle 2013-12-17 23:08:18 -07:00
parent 7b219c18c7
commit 06ee34c09b
3 changed files with 5 additions and 7 deletions

View file

@ -18,7 +18,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
$rootScope.User = User;
$rootScope.user = user;
$rootScope.moment = window.moment;
$rootScope.moment = window._;
$rootScope._ = window._;
$rootScope.settings = User.settings;
$rootScope.Shared = window.habitrpgShared;
$rootScope.Content = window.habitrpgShared.content;
@ -165,8 +165,6 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
$scope.castEnd = function(target, type, $event){
if ($scope.spell.target != type) return Notification.text("Invalid target");
$scope.spell.cast(User.user, target);
$rootScope.applyingAction = false;
$scope.spell = null;
$http.post('/api/v2/user/class/cast/' + $scope.spell.name, {target:target, type:type}).success(function(){
var msg = "You cast " + $scope.spell.text;
switch (type) {
@ -175,7 +173,9 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
case 'party': msg += ' on the Party';break;
}
Notification.text(msg);
})
$scope.spell = null;
});
$rootScope.applyingAction = false;
$event && $event.stopPropagation();
}

View file

@ -347,7 +347,7 @@ api.cast = function(req, res) {
uuid: user._id,
contributor: user.contributor && user.contributor.toObject(),
backer: user.backer && user.backer.toObject(),
text: '`casts ' + spell.text + ' on ' + (type == 'user' ? found.profile.name : 'the party') + '`',
text: '`casts ' + spell.text + ' on ' + (type == 'user' ? '@'+found.profile.name : 'the party') + '`',
user: '<'+user.profile.name+'>',
timestamp: +new Date
});

View file

@ -41,7 +41,5 @@ figure.herobox(ng-click='spell ? castEnd(profile, "user", $event) : clickMember(
// FIXME handle @minimal, this might have to be a directive
span.current-pet(class='Pet-{{profile.items.currentPet}}', ng-show='profile.items.currentPet && !minimal')
.avatar-level(ng-class='userLevelStyle(profile,"label")')
//- why isn't this working?
//-i.icon-circle-arrow-up.icon-white(ng-hide='_.isEmpty(profile.stats.buffs)', tooltip='Buffed', style='margin-right:5px;')
i.icon-circle-arrow-up.icon-white(ng-show='profile.stats.buffs.str || profile.stats.buffs.per || profile.stats.buffs.con || profile.stats.buffs.int || profile.stats.buffs.stealth', tooltip='Buffed', style='margin-right:5px;')
| Lvl {{profile.stats.lvl}}