mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 20:14:00 +08:00
Merge pull request #934 from datitisev/249-avatar-editor-big-upload-button
#249 AvatarEditor should show an upload icon instead of a user's default avatar
This commit is contained in:
commit
5f60297eb1
4
js/forum/dist/app.js
vendored
4
js/forum/dist/app.js
vendored
|
@ -18995,10 +18995,10 @@ System.register('flarum/components/AvatarEditor', ['flarum/Component', 'flarum/h
|
|||
avatar(user),
|
||||
m(
|
||||
'a',
|
||||
{ className: 'Dropdown-toggle',
|
||||
{ className: user.avatarUrl() ? "Dropdown-toggle" : "Dropdown-toggle AvatarEditor--noAvatar",
|
||||
'data-toggle': 'dropdown',
|
||||
onclick: this.quickUpload.bind(this) },
|
||||
this.loading ? LoadingIndicator.component() : icon('pencil')
|
||||
this.loading ? LoadingIndicator.component() : user.avatarUrl() ? icon('pencil') : icon('upload')
|
||||
),
|
||||
m(
|
||||
'ul',
|
||||
|
|
|
@ -37,10 +37,10 @@ export default class AvatarEditor extends Component {
|
|||
return (
|
||||
<div className={'AvatarEditor Dropdown ' + this.props.className + (this.loading ? ' loading' : '')}>
|
||||
{avatar(user)}
|
||||
<a className="Dropdown-toggle"
|
||||
data-toggle="dropdown"
|
||||
onclick={this.quickUpload.bind(this)}>
|
||||
{this.loading ? LoadingIndicator.component() : icon('pencil')}
|
||||
<a className={ user.avatarUrl() ? "Dropdown-toggle" : "Dropdown-toggle AvatarEditor--noAvatar" }
|
||||
data-toggle="dropdown"
|
||||
onclick={this.quickUpload.bind(this)}>
|
||||
{this.loading ? LoadingIndicator.component() : (user.avatarUrl() ? icon('pencil') : icon('upload'))}
|
||||
</a>
|
||||
<ul className="Dropdown-menu Menu">
|
||||
{listItems(this.controlItems().toArray())}
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
text-decoration: none;
|
||||
border: 0;
|
||||
}
|
||||
.AvatarEditor--noAvatar {
|
||||
opacity: 0.7;
|
||||
}
|
||||
&:hover .Dropdown-toggle, &.open .Dropdown-toggle, &.loading .Dropdown-toggle {
|
||||
opacity: 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user