[#1821] [#1723] fix pet counters (incl for member modals)

This commit is contained in:
Tyler Renelle
2013-11-15 17:50:41 -08:00
parent 34ea6038f1
commit 2b286ba889
4 changed files with 10 additions and 9 deletions

View File

@@ -21,6 +21,9 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
return haystack && ~haystack.indexOf(needle);
}
// count pets, mounts collected totals, etc
$rootScope.countExists = function(items) {return _.reduce(items,function(m,v){return m+(v?1:0)},0)}
$scope.safeApply = function(fn) {
var phase = this.$root.$$phase;
if(phase == '$apply' || phase == '$digest') {