Fixed member modal on front page

This commit is contained in:
Keith Holliday
2016-05-16 09:54:22 -05:00
parent ad03cc8f9a
commit 11b567038e
4 changed files with 17 additions and 12 deletions

View File

@@ -6,18 +6,21 @@ window.habitrpg = angular.module('habitrpg', ['chieffancypants.loadingBar', 'ui.
.constant("STORAGE_SETTINGS_ID", 'habit-mobile-settings')
.constant("MOBILE_APP", false)
.controller("RootCtrl", ['$scope', '$location', '$modal', '$http', 'Stats', function($scope, $location, $modal, $http, Stats){
.controller("RootCtrl", ['$scope', '$location', '$modal', '$http', 'Stats', 'Members',
function($scope, $location, $modal, $http, Stats, Members) {
var memberId = $location.search()['memberId'];
if (memberId) {
$http.get('/api/v2/members/'+memberId).success(function(data, status, headers, config){
$scope.profile = window.habitrpgShared.wrap(data, false);
$scope.statCalc = Stats;
$scope.Content = window.habitrpgShared.content;
$modal.open({
templateUrl: 'modals/member.html',
scope: $scope
Members.fetchMember(memberId)
.success(function(response) {
$scope.profile = response.data;
$scope.statCalc = Stats;
$scope.Content = window.habitrpgShared.content;
$modal.open({
templateUrl: 'modals/member.html',
scope: $scope
});
});
})
}
$http.defaults.headers.common['x-client'] = 'habitica-web';