mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-23 14:28:45 +01:00
prefer source attribute (with cache-buster) over contact_id
add cache-buster, if we have just a contact_id
This commit is contained in:
parent
f9dd120d32
commit
4532221717
@ -365,6 +365,8 @@ var et2_avatar = (function(){ "use strict"; return et2_image.extend(
|
||||
};
|
||||
var id = 'contact_id';
|
||||
|
||||
this.image.addClass('et2_avatar');
|
||||
|
||||
if (!_contact_id)
|
||||
{
|
||||
_contact_id = this.egw().user('account_id');
|
||||
@ -380,8 +382,15 @@ var et2_avatar = (function(){ "use strict"; return et2_image.extend(
|
||||
_contact_id = _contact_id.replace('contact:', '');
|
||||
}
|
||||
|
||||
// if our src (incl. cache-buster) already includes the correct id, use that one
|
||||
if (this.options.src && this.options.src.match("(&|\\?)contact_id="+_contact_id+"(&|\\$)"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// we have only the id, so we need to bypass caching with a cache-buster
|
||||
params[id] = _contact_id;
|
||||
this.image.addClass('et2_avatar');
|
||||
params._cache = (new Date).getTime();
|
||||
|
||||
var url = egw.link('/index.php',params);
|
||||
this.set_src(url);
|
||||
|
Loading…
Reference in New Issue
Block a user