mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Fixed member modal on front page
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user