mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
fix for #1920, again. this is very 'un-angular' but it *actually* works. the proper way to do this is make a directive for 'userlevel' or something and have that apply the proper styles
This commit is contained in:
@@ -21,6 +21,16 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
return haystack && ~haystack.indexOf(needle);
|
||||
}
|
||||
|
||||
// styling helpers
|
||||
$scope.userLevelStyle = function(user,style){
|
||||
style = style || '';
|
||||
if(user.backer.npc)
|
||||
style += ' label-npc';
|
||||
if(user.contributor.level)
|
||||
style += ' label-contributor-'+user.contributor.level;
|
||||
return style;
|
||||
}
|
||||
|
||||
// count pets, mounts collected totals, etc
|
||||
$rootScope.countExists = function(items) {return _.reduce(items,function(m,v){return m+(v?1:0)},0)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user