Editor.ImageGalleryModel = Editor.Model.extend({
_className: 'Editor.ImageGalleryModel',
- serverURL: null,
+ serverURL: null,
+ data: [],
state: 'empty',
init: function(serverURL) {
alert('erroneous state:', this.get('state'));
}
- this.set('pages', data[0].pages);
+ $.log('galleries:', data);
+
+ if (data.length == 0)
+ this.set('data', []);
+ else {
+ $.log('dupa');
+ this.set('data', data[0].pages);
+ }
+
this.set('state', 'synced');
},