Merge branch 'master' of github.com:RocketChat/Rocket.Chat

# By Rodrigo Nascimento
# Via Rodrigo Nascimento
* 'master' of github.com:RocketChat/Rocket.Chat:
  Fix position of avatar initials
  Implement Avatar.getInitials to get initials from user.name
pull/1/head
Gabriel Engel 10 years ago
commit ce29eefff7
  1. 10
      client/lib/avatar.coffee
  2. 20
      client/stylesheets/dashboard.less

@ -1,2 +1,12 @@
Avatar.options =
defaultImageUrl: "/images/no_picture.png"
Avatar.getInitials = (user) ->
initials = ''
if user?.name?
parts = user.name.split(' ');
initials = _.first(parts).charAt(0).toUpperCase()
if parts.length > 1
initials += _.last(parts).charAt(0).toUpperCase()
return initials

@ -603,6 +603,9 @@ form.search-form {
right: 5px;
bottom: 10px;
}
.avatar-initials {
line-height: 44px;
}
}
.data {
float: left;
@ -1330,6 +1333,9 @@ form.search-form {
&.own:hover .edit-message {
display: inherit;
}
.avatar-initials {
line-height: 40px;
}
}
.pageView {
display: table;
@ -1622,7 +1628,10 @@ form.search-form {
height: 100px;
.avatar {
border-radius: 4px;
box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3)
box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
.avatar-initials {
line-height: 100px;
}
}
}
.nav {}
@ -1788,10 +1797,11 @@ form.search-form {
}
}
}
img {
.avatar {
border-radius: 2px;
display: block;
width: 100%;
.avatar-initials {
line-height: 45px;
}
}
a {
display: block;
@ -1824,7 +1834,7 @@ form.search-form {
border: 3px solid #F8F8F8;
border-radius: 50%;
left: -5px;
z-index: 5;
z-index: 10;
}
&.status-offline {
&:after, &:before {

Loading…
Cancel
Save