Users avatar Class
Avatar representing a user
Constructor
Users avatar
-
prefix
-
[options]
-
[options.templates.icon.fields.alt="user
Parameters:
-
prefix
StringPrefix of the tool to be constructed.
-
[options]
Object optionalA hash of options, containing:
-
userId
StringThe id of the user object. Defaults to id of the logged-in user, if any. Can be '' for a blank-looking avatar.
-
[icon=Q.Users.icon.defaultSize]
Number | String | True optionalSize of the icon to render before the display name. Or 0 for no icon. You can also pass true here for default size. Or pass a string to specify the url of the icon.
-
[contents=true]
Boolean optionalSet to false to not show the name
-
[short=false]
Boolean optionalIf true, renders the short version of the display name.
-
[editable=false]
Boolean | Array optionalIf true, and userId is the logged-in user's id, the tool presents an interface for the logged-in user to edit their name and icon. This can also be an array containing one or more of 'icon', 'name'.
-
[short=false]
Boolean optionalIf true, renders the short version of the display name.
-
[className]
String optionalAny css classes to add to the tool element
-
[reflectChanges=true]
Boolean optionalWhether the tool should update its contents on changes to user streams like firstName, lastName, username and icon. Set to false if you are showing many avatars in a list such as "Users/list" or "Streams/participating" tools. Otherwise it can result many database queries – one per avatar!
-
[reflectIconChanges=String(options.icon).isUrl()]
Boolean optionalWhether to automatically update the icon if the user's icon stream changes
-
[cacheBust=null]
Number optionalNumber of milliseconds to use for combating the re-use of cached images when they are first loaded.
-
[templates]
Object optional-
[icon]
Object optional -
[icon.dir='{{Users}}/views']
String optional -
[icon.name='Users/avatar/icon']
String optional -
[icon.fields]
Object optional -
[contents]
Object optional -
[contents.dir='{{Users}}/views']
String optional -
[contents.name='Users/avatar/contents']
String optional -
[contents.fields]
Object optional -
[contents.fields.tag="span"]
String optional
-
-
[inplaces]
Object optionalAdditional fields to pass to the child Streams/inplace tools, if any
-
[onRefresh]
Q.Event optionalAn event that occurs when the avatar is refreshed
-
[onUpdate]
Q.Event optionalAn event that occurs when the icon is updated via this tool
-
[onImagepicker]
Q.Event optionalAn event that occurs when the imagepicker is activated
-
[onMissing]
Q.Event optionalAn event that occurs if the avatar info turns out to be missing
-
-
[options.templates.icon.fields.alt="user
Stringicon"]