mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-20 21:08:54 +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
79a90202a8
commit
790d96eb15
@ -363,6 +363,8 @@ var et2_avatar = (function(){ "use strict"; return et2_image.extend(
|
|||||||
var params = {};
|
var params = {};
|
||||||
var id = 'contact_id';
|
var id = 'contact_id';
|
||||||
|
|
||||||
|
this.image.addClass('et2_avatar');
|
||||||
|
|
||||||
if (!_contact_id)
|
if (!_contact_id)
|
||||||
{
|
{
|
||||||
_contact_id = this.egw().user('account_id');
|
_contact_id = this.egw().user('account_id');
|
||||||
@ -378,8 +380,15 @@ var et2_avatar = (function(){ "use strict"; return et2_image.extend(
|
|||||||
_contact_id = _contact_id.replace('contact:', '');
|
_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;
|
params[id] = _contact_id;
|
||||||
this.image.addClass('et2_avatar');
|
params._cache = (new Date).getTime();
|
||||||
|
|
||||||
var url = egw.link('/api/avatar.php',params);
|
var url = egw.link('/api/avatar.php',params);
|
||||||
this.set_src(url);
|
this.set_src(url);
|
||||||
|
Loading…
Reference in New Issue
Block a user