AvatarEditor
Extends:
The AvatarEditor
component displays a user's avatar along with a dropdown
menu which allows the user to upload/remove the avatar.
Attrs
className
user
Member Summary
Public Members | ||
public |
Whether or not an image has been dragged over the dropzone. |
|
public |
Whether or not an avatar upload is in progress. |
Method Summary
Public Methods | ||
public |
Get the items in the edit avatar dropdown menu. |
|
public |
disableDragover(e: Event) Disable dragover style |
|
public |
dropUpload(e: Event) Upload avatar when file is dropped into dropzone. |
|
public |
enableDragover(e: Event) Enable dragover style |
|
public |
oninit(vnode: *) |
|
public |
Upload avatar using file picker |
|
public |
quickUpload(e: Event) If the user doesn't have an avatar, there's no point in showing the controls dropdown, because only one option would be viable: uploading. |
|
public |
remove() Remove the user's avatar. |
|
public |
upload(file: File) Upload avatar |
|
public |
view(): * |
Protected Methods | ||
protected |
If avatar upload/removal fails, stop loading. |
|
protected |
After a successful upload/removal, push the updated user data into the store, and force a recomputation of the user's avatar color. |
Public Members
Public Methods
public disableDragover(e: Event) source
Disable dragover style
Params:
Name | Type | Attribute | Description |
e | Event |
public dropUpload(e: Event) source
Upload avatar when file is dropped into dropzone.
Params:
Name | Type | Attribute | Description |
e | Event |
public enableDragover(e: Event) source
Enable dragover style
Params:
Name | Type | Attribute | Description |
e | Event |
public oninit(vnode: *) source
Params:
Name | Type | Attribute | Description |
vnode | * |
public quickUpload(e: Event) source
If the user doesn't have an avatar, there's no point in showing the controls dropdown, because only one option would be viable: uploading. Thus, when the avatar editor's dropdown toggle button is clicked, we prompt the user to upload an avatar immediately.
Params:
Name | Type | Attribute | Description |
e | Event |