Added cache system

This commit is contained in:
Pierre
2017-06-14 11:46:10 +02:00
parent aa74943b01
commit f750165c3e
13 changed files with 295 additions and 26 deletions

View File

@ -62,8 +62,9 @@ ComunicWeb.components.friends.bar = {
this.refresh(listFriendsElem);
//Remove previously existing interval
if(this.refreshInterval)
if(this.refreshInterval){
clearInterval(this.refreshInterval);
}
//Make the friend bar automaticaly refreshed
this.refreshInterval = setInterval(function(){

View File

@ -89,4 +89,21 @@ ComunicWeb.components.friends.list = {
//Success
return true;
},
};
/**
* Empty friends cache list
*
* @return {Boolean} True for a success
*/
emptyCache: function(){
//Empty cache
this.__list = {};
//Success
return true;
}
};
//Register cache cleaner
ComunicWeb.common.cacheManager.registerCacheCleaner("ComunicWeb.components.friends.list.emptyCache");