Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 5c9b752

Browse files
committed
Added cloaking, fixed navigation to dev page
1 parent 0ac2fda commit 5c9b752

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

app/profile/develop/develop.controller.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
vm.domain = CONSTANTS.domain;
1414
vm.challenges = [];
1515
vm.profile = {};
16+
vm.loading = true;
1617

1718
activate();
1819

@@ -21,13 +22,17 @@
2122
$scope.initProfile(vm);
2223
vm.deferred = $q.defer();
2324
vm.deferred.promise.then(function() {
25+
console.log('resol')
2426
vm.typeStats = ProfileService.getChallengeTypeStats(vm.stats, 'develop', vm.subTrack.toLowerCase().replace(/ /g, ''));
2527
ChallengeService.getChallenges({
2628
filter: 'userId=' + vm.profile.userId
2729
}).then(function(data) {
2830
vm.challenges = data;
2931
});
3032
});
33+
if (vm.altResolve) {
34+
vm.deferred.resolve(vm);
35+
}
3136
}
3237

3338
}

app/profile/develop/develop.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.profile-develop-container
1+
.profile-develop-container(ng-hide='vm.loading', ng-cloak)
22
hr
33
h1.type Develop: {{vm.subTrack}}
44
hr

app/profile/profile.controller.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
vm.title = "Profile";
1313
vm.message = "Message"
1414
vm.profile = {};
15+
vm.loading = true;
1516
vm.userHandle = userHandle;
1617

1718
activate(vms);
@@ -42,12 +43,24 @@
4243
// until horizontal scroll is implemented
4344
vm.skills = skills.skills;
4445
vm.categories = ProfileService.getRanks(vm.stats);
46+
vm.loading = false;
4547
});
4648
});
4749
}
4850

49-
$scope.initProfile = function(vm) {
50-
vms.push(vm);
51+
$scope.initProfile = function(newVm) {
52+
if (!vm.stats) {
53+
vms.push(newVm);
54+
} else {
55+
newVm.profile = vm.profile;
56+
newVm.stats = vm.stats;
57+
newVm.numProjects = vm.numProjects;
58+
newVm.numWins = vm.numWins;
59+
newVm.skills = vm.skills;
60+
newVm.categories = vm.categories;
61+
newVm.altResolve = true;
62+
newVm.loading = false;
63+
}
5164
}
5265

5366
}

app/profile/profile.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.profile-header-container
1+
.profile-header-container(ng-hide="vm.loading", ng-cloak)
22
.left
33
profile-widget(profile="vm.profile", edit-profile-link="vm.showEditProfileLink")
44
.right
55
h4 member for {{vm.tenure}} years
66

7-
ui-view
7+
ui-view(ng-hide="vm.loading", ng-cloak)

0 commit comments

Comments
 (0)