Moved show counters to directive (#8537)

* Moved show counters to directive

- hide counters on challenge page
- hide counters on group page

* Changed let to var
This commit is contained in:
Keith Holliday
2017-03-07 13:58:39 -07:00
committed by GitHub
parent 7f630f2b86
commit 28c93ea869
3 changed files with 16 additions and 4 deletions

View File

@@ -72,7 +72,19 @@
$scope.showChallengeList = function () {
return $state.includes("options.social.challenges");
};
$scope.showDoubleTaskCounter = function (task, obj) {
var objectIsGroup = obj.type && (obj.type === 'guild' || obj.type === 'party');
var objectIsChallenge = $state.includes("options.social.challenges");
return !objectIsGroup && !objectIsChallenge && task.up && task.down;
};
$scope.showSingleTaskCounter = function (task, obj) {
var objectIsGroup = obj.type && (obj.type === 'guild' || obj.type === 'party');
var objectIsChallenge = $state.includes("options.social.challenges");
return !objectIsGroup && !objectIsChallenge && task.type === "habit" && (!task.up || !task.down);
};
}
}
}
}());
}());