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() {
|
this.export=function() {
|
||||||
return this.each(function(idx,group) {
|
return {
|
||||||
return group.export();
|
'lastChange': this.lastChange,
|
||||||
});
|
'groups': this.each(function(idx,group) {
|
||||||
|
return group.export();
|
||||||
|
})
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.import=function(groups) {
|
this.import=function(groups) {
|
||||||
|
@ -40,18 +43,16 @@ function GroupList() {
|
||||||
delete ret[el];
|
delete ret[el];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (el in groups) {
|
this.lastChange=groups.lastChange;
|
||||||
this[el]=new Group(el,false,groups[el]);
|
for (el in groups.groups) {
|
||||||
|
this[el]=new Group(el,false,groups.groups[el]);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.save=function() {
|
this.save=function() {
|
||||||
localStorage.groups=JSON.stringify({
|
localStorage.groups=JSON.stringify(this.export());
|
||||||
'lastChange': new Date().getTime(),
|
|
||||||
'groups': this.export()
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.each=function(fct) {
|
this.each=function(fct) {
|
||||||
|
|
Loading…
Reference in a new issue