I did a little more testing and found that I was saving the names of the open DIVs regardless of the 'persist' setting. So here is the revised 'uninit' method (revision highlighted):
Code:
uninit:function(){
var opendivids=new Array();//ITLAN
var groupswithpersist='';
var persistopenids=this.getCookie('acopendivids'); //ITLAN
if (persistopenids!=null){ //ITLAN
persistopenids=(persistopenids=='nada')? [] : persistopenids.split(','); //ITLAN
}
else { persistopenids=new Array();} //ITLAN
opendivids=persistopenids; //ITLAN
jQuery.each(this.divholders, function(){
index=-1;
index=jQuery.inArray(this.id, persistopenids); //ITLAN
if ((this.$divref.css('display')!='none') && this.getAttr('persist')) {
if (index !=-1){ //ITLAN
//open DIV already in cookie
}
else{ //ITLAN
//add DIV to cookie
opendivids.push(this.id); //ITLAN
}
}
else if (index !=-1) { //ITLAN
//Remove DIV from cookie
opendivids.splice(this.id,1); //ITLAN
}
else{
//Do nothing
}
if (this.getAttr('group') && this.getAttr('persist'))
groupswithpersist+=this.getAttr('group')+','; //store groups with which at least one DIV has persistance enabled: 'group1,group2,etc'
});
if (opendivids!=null) opendivids=opendivids.join(','); //ITLAN
opendivids = (opendivids=='') ? 'nada' : opendivids.replace(/,$/, '');
groupswithpersist = (groupswithpersist=='') ? 'nada' : groupswithpersist.replace(/,$/, '');
this.setCookie('acopendivids', opendivids);
this.setCookie('acgroupswithpersist', groupswithpersist);
},
Also should be noted I did not enhance the 'Groups with persist' part.
Bookmarks