Skip to content

Commit 4710a39

Browse files
Fix profile menu image and layout issues (#7)
1 parent 9aba114 commit 4710a39

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

cd-menu/cd-menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ window.cdMenu = function (options) {
152152
profileLink.href = zenBase + '/profile/' + userData.user.id;
153153
});
154154
each(profilePics, function (profilePic) {
155-
profilePic.src = zenBase + '/api/2.0/profiles/' + userData.user.profileId + '/avatar_img';
155+
profilePic.style.backgroundImage = 'url(' + zenBase + '/api/2.0/profiles/' + userData.user.profileId + '/avatar_img)';
156156
});
157157
if (userData.user.roles.indexOf('cdf-admin') !== -1) {
158158
each(cdfAdminMenuLinks, function (menuLink) {

cd-menu/cd-menu.less

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
align-items: center;
1616

1717
&-pic {
18+
display: inline-block;
19+
background-image: url(/img/avatar.png);
20+
background-repeat: no-repeat;
21+
background-size: cover;
22+
background-position: center;
1823
border-radius: 100%;
1924
width: 32px;
2025
height: 32px;
@@ -301,7 +306,9 @@
301306
}
302307

303308
&__sliding-menu .cd-menu__content > ul > li > a, &__sliding-menu .cd-menu__content > ul > li > span {
304-
display: block;
309+
display: flex;
310+
flex: 1;
311+
align-items: center;
305312
text-transform: uppercase;
306313
color: @cd-dark-grey;
307314
padding: 12px;
@@ -368,10 +375,9 @@
368375
margin: 0;
369376
padding: 12px;
370377

371-
> img {
378+
.cd-menu__profile-pic {
372379
width: 128px;
373380
height: 128px;
374-
border-radius: 100%;
375381
}
376382

377383
> span {

dist/cd-common.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cd-common.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)