this.set('state', 'dirty');
},
+ // For debbuging
set: function(property, value) {
if (property == 'state') {
console.log(this.description(), ':', property, '=', value);
this.set('data', data);
this.set('state', 'synced');
},
-
+
+ // For debbuging
set: function(property, value) {
if (property == 'state') {
console.log(this.description(), ':', property, '=', value);
contentModelStateChanged: function(property, value, contentModel) {
if (value == 'dirty') {
+ this.set('state', 'dirty');
for (var key in this.contentModels) {
if (this.contentModels[key].guid() != contentModel.guid()) {
- // console.log(this.contentModels[key].description(), 'frozen');
this.contentModels[key].set('state', 'unsynced');
}
}
+ } else if (value == 'updated') {
+ this.set('state', 'synced');
+ for (key in this.contentModels) {
+ if (this.contentModels[key].guid() == contentModel.guid()) {
+ this.contentModels[key].set('state', 'synced');
+ } else if (this.contentModels[key].get('state') == 'unsynced') {
+ this.contentModels[key].set('state', 'empty');
+ }
+ }
}
},
break;
}
}
+ },
+
+ // For debbuging
+ set: function(property, value) {
+ if (property == 'state') {
+ console.log(this.description(), ':', property, '=', value);
+ }
+ return this._super(property, value);
}
});