Added param to filter challenges by guild when a challenge is first clicked from guild

This commit is contained in:
TheHollidayInn
2015-09-20 10:26:08 -05:00
parent 87f6af346a
commit 43c9683a8b
3 changed files with 9 additions and 2 deletions

View File

@@ -5,6 +5,8 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
// challenge
$scope.cid = $state.params.cid;
$scope.groupIdFilter = $stateParams.groupIdFilter;
_getChallenges();
// FIXME $scope.challenges needs to be resolved first (see app.js)
@@ -381,6 +383,11 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
_isMember: "either",
_isOwner: "either"
};
//If we game from a group, then override the filter to that group
if ($scope.groupIdFilter) {
$scope.search.group = {};
$scope.search.group[$scope.groupIdFilter] = true ;
}
});
}
};