mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Et2LAvatar: Update statustext (tooltip) with name based on lname & fname
This commit is contained in:
parent
86376bdc0c
commit
346a720d27
@ -65,7 +65,8 @@ export class Et2LAvatar extends Et2Avatar
|
|||||||
{
|
{
|
||||||
super.updated(changedProperties);
|
super.updated(changedProperties);
|
||||||
|
|
||||||
if (changedProperties.has("lname") || changedProperties.has("fname") || changedProperties.has("contact_id") || changedProperties.has("src")) {
|
if(changedProperties.has("lname") || changedProperties.has("fname") || changedProperties.has("contact_id") || changedProperties.has("src"))
|
||||||
|
{
|
||||||
if(!this.src || decodeURIComponent(this.src).match("lavatar=1") && (this.fname || this.lname) && this.contact_id)
|
if(!this.src || decodeURIComponent(this.src).match("lavatar=1") && (this.fname || this.lname) && this.contact_id)
|
||||||
{
|
{
|
||||||
let lavatar = Et2LAvatar.lavatar(this.fname, this.lname, this.contact_id);
|
let lavatar = Et2LAvatar.lavatar(this.fname, this.lname, this.contact_id);
|
||||||
@ -76,6 +77,18 @@ export class Et2LAvatar extends Et2Avatar
|
|||||||
{
|
{
|
||||||
this.image = this.src;
|
this.image = this.src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.lname || this.fname)
|
||||||
|
{
|
||||||
|
// Update tooltip - we don't have enough info for more than name but we can put it in the right order
|
||||||
|
let label = (this.egw().preference("account_display", "common") || "firstname").includes("first") || !this.lname || !this.fname ?
|
||||||
|
this.fname + " " + this.lname :
|
||||||
|
this.lname + ", " + this.fname;
|
||||||
|
if(label != this.statustext)
|
||||||
|
{
|
||||||
|
this.statustext = label.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user