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

Added scrolling to tracks from profile widget #364

Merged
merged 2 commits into from
Oct 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/directives/profile-widget/profile-widget.jade
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@

.tracks-links
.tracks
.track(ng-repeat="track in (profile.tracks)")
.track(ng-repeat="track in (profile.tracks)", ng-click="profileVm.scrollTo(track)")
div(class="{{profileVm.imgMap[track]}}-icon")
div
.text {{track | role}}
3 changes: 2 additions & 1 deletion app/profile/about/about.jade
Original file line number Diff line number Diff line change
@@ -44,7 +44,8 @@

.track(
ng-repeat="track in profileVm.profile.tracks",
ng-if="profileVm.categories[track].length > 0"
ng-if="profileVm.categories[track].length > 0",
id="{{track}}_TRACK"
)

div(class="name")
9 changes: 7 additions & 2 deletions app/profile/profile.controller.js
Original file line number Diff line number Diff line change
@@ -5,16 +5,17 @@

ProfileCtrl.$inject = ['CONSTANTS', '$log', '$q',
'TcAuthService', 'UserService', 'ProfileService', 'ChallengeService', 'ExternalAccountService',
'userHandle', 'profile', 'ngDialog'
'userHandle', 'profile', 'ngDialog', '$anchorScroll'
];

function ProfileCtrl(CONSTANTS, $log, $q, TcAuthService, UserService, ProfileService, ChallengeService, ExternalAccountService, userHandle, profile, ngDialog) {
function ProfileCtrl(CONSTANTS, $log, $q, TcAuthService, UserService, ProfileService, ChallengeService, ExternalAccountService, userHandle, profile, ngDialog, $anchorScroll) {
var vm = this;
// set profile to the object that was resolved
vm.profile = profile;
vm.userHandle = userHandle;
vm.showBadges = showBadges;
vm.closeDialog = closeDialog;
vm.scrollTo = scrollTo;

vm.imgMap = {
'DEVELOP': 'develop',
@@ -97,6 +98,10 @@
function closeDialog() {
ngDialog.close();
}

function scrollTo(track) {
$anchorScroll(track + '_TRACK');
}
}

})();
1 change: 1 addition & 0 deletions assets/css/directives/profile-widget.scss
Original file line number Diff line number Diff line change
@@ -79,6 +79,7 @@
justify-content: flex-end;
width: 100%;
.track {
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;