mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Subdocs & script templates. Migrate the API from User.tasks =>
User.habits/dailys/todos/rewards. Move /#/tasks & /#/options page loading from server-sent html to everything loaded in the page as script templates (including necessary fixes for adsense). NOTE: this commit won't work, it depends a bit on the *next* commit with Challenges functionality, but I wanted to separate it out a bit for clarity
This commit is contained in:
@@ -12,6 +12,11 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
$rootScope.settings = User.settings;
|
||||
$rootScope.flash = {errors: [], warnings: []};
|
||||
|
||||
// indexOf helper
|
||||
$scope.indexOf = function(haystack, needle){
|
||||
return ~haystack.indexOf(needle);
|
||||
}
|
||||
|
||||
$scope.safeApply = function(fn) {
|
||||
var phase = this.$root.$$phase;
|
||||
if(phase == '$apply' || phase == '$digest') {
|
||||
|
||||
Reference in New Issue
Block a user