File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,22 @@ $(document).ready(function () {
77 $cardDiv = $cardDiv . children ( ':last-child' )
88
99 $cardDiv . append ( '<div class="user-card-avatar"><img src="' + userData . avatar_url + '"/></div>' ) ;
10+ var $avatarDiv = $cardDiv . children ( ':last-child' ) ;
1011 $cardDiv . append ( '<div class="user-card-text"></div>' ) ;
1112 var $textDiv = $cardDiv . children ( ':last-child' ) ;
13+
1214 $textDiv . append ( '<div class="user-card-name">' + ( userData . name || userData . login ) + '</div>' ) ;
1315 $textDiv . append ( '<div class="user-card-login">@' + userData . login + '</div>' ) ;
16+
17+ // Give the text a margin to make sure it does not go below the avatar
18+ $avatarDiv . resize ( function ( ) {
19+ $textDiv . css ( {
20+ width : 'auto' ,
21+ "margin-left" : $avatarDiv . width ( )
22+ } ) ;
23+ } ) ;
24+
25+ $avatarDiv . resize ( ) ;
1426 } ) ;
1527 } ) ;
1628} ) ;
You can’t perform that action at this time.
0 commit comments