X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/7aa07c7bcc96b144ed562f58dde3dce717524985..ddfd0025304ea7087fdd2a4e06893a6f998b9f19:/project/static/js/views/gallery.js diff --git a/project/static/js/views/gallery.js b/project/static/js/views/gallery.js index ad17c4be..74493444 100644 --- a/project/static/js/views/gallery.js +++ b/project/static/js/views/gallery.js @@ -12,6 +12,8 @@ var ImageGalleryView = View.extend({ console.log("init for gallery"); this._super(element, model, template); this.parent = parent; + + console.log("galley model", this.model); this.model .addObserver(this, 'data', this.modelDataChanged.bind(this)) @@ -79,6 +81,8 @@ var ImageGalleryView = View.extend({ this.$pageInput.val( (this.currentPage+1) ); }, + reload: function() {}, + modelStateChanged: function(property, value) { if (value == 'loading') { this.parent.freeze('Ładowanie...'); @@ -205,7 +209,7 @@ var ImageGalleryView = View.extend({ render: function() { - console.log('rendering:', this._className); + if(!this.model) return; /* first unbind all */ if(this.$nextButton) this.$nextButton.unbind(); @@ -218,7 +222,7 @@ var ImageGalleryView = View.extend({ if(this.$zoomResetButton) this.$zoomResetButton.unbind(); /* render */ - this.element.html(render_template(this.template, this)); + this._super(); /* fetch important parts */ this.$pageListRoot = $('.image-gallery-page-list', this.element);