Add lastChange in GroupList export return
This commit is contained in:
parent
52f4d37b88
commit
a2e33ea274
1 changed files with 10 additions and 9 deletions
|
@ -28,9 +28,12 @@ function GroupList() {
|
|||
}
|
||||
|
||||
this.export=function() {
|
||||
return this.each(function(idx,group) {
|
||||
return group.export();
|
||||
});
|
||||
return {
|
||||
'lastChange': this.lastChange,
|
||||
'groups': this.each(function(idx,group) {
|
||||
return group.export();
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
this.import=function(groups) {
|
||||
|
@ -40,18 +43,16 @@ function GroupList() {
|
|||
delete ret[el];
|
||||
}
|
||||
}
|
||||
for (el in groups) {
|
||||
this[el]=new Group(el,false,groups[el]);
|
||||
this.lastChange=groups.lastChange;
|
||||
for (el in groups.groups) {
|
||||
this[el]=new Group(el,false,groups.groups[el]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
this.save=function() {
|
||||
localStorage.groups=JSON.stringify({
|
||||
'lastChange': new Date().getTime(),
|
||||
'groups': this.export()
|
||||
});
|
||||
localStorage.groups=JSON.stringify(this.export());
|
||||
}
|
||||
|
||||
this.each=function(fct) {
|
||||
|
|
Loading…
Reference in a new issue