Skip to content

Commit f1df37c

Browse files
committed
Fix issues with layout in user cards
- Fixes an issue where the avatar would extend outside the card in Firefox - Bypasses a race condition that made card layout dependent on avatar load time
1 parent af2d65d commit f1df37c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

javascripts/cards.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ $(document).ready(function () {
1414
$textDiv.append('<div class="user-card-name">' + (userData.name || userData.login) + '</div>');
1515
$textDiv.append('<div class="user-card-login">@' + userData.login + '</div>');
1616

17-
// Give the text a margin to make sure it does not go below the avatar
17+
// Give the text a margin to make sure it does not overlap the avatar
1818
$avatarDiv.resize(function() {
1919
$textDiv.css({
2020
width: 'auto',
21-
"margin-left": $avatarDiv.width()
21+
"margin-left": $avatarDiv.height()
2222
});
2323
});
2424

stylesheets/user-cards.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
position: absolute;
4545
float: left;
4646
height: 100%;
47-
width: auto;
47+
width: 0;
4848
top: 50%;
4949
-webkit-transform: translateY(-50%);
5050
-ms-transform: translateY(-50%);

0 commit comments

Comments
 (0)