X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3546a2b2d5f52224bcf95803030611ab505f29cd..2384208b1967f12992caf087dca475d70fa765a3:/project/static/js/models.js diff --git a/project/static/js/models.js b/project/static/js/models.js index 13dc2ea0..5d3fac49 100644 --- a/project/static/js/models.js +++ b/project/static/js/models.js @@ -181,7 +181,8 @@ Editor.HTMLModel = Editor.Model.extend({ Editor.ImageGalleryModel = Editor.Model.extend({ _className: 'Editor.ImageGalleryModel', - serverURL: null, + serverURL: null, + data: [], state: 'empty', init: function(serverURL) { @@ -208,7 +209,15 @@ Editor.ImageGalleryModel = Editor.Model.extend({ 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'); },