From: zuber Date: Thu, 5 Nov 2009 15:09:10 +0000 (+0100) Subject: Poprawienie logiki render w ImageGalleryView. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/04b05946ab640eaf9135a73772b704dd41c323e7 Poprawienie logiki render w ImageGalleryView. --- diff --git a/platforma/static/js/views/gallery.js b/platforma/static/js/views/gallery.js index 1808ea18..d3398ce0 100644 --- a/platforma/static/js/views/gallery.js +++ b/platforma/static/js/views/gallery.js @@ -218,21 +218,22 @@ var ImageGalleryView = View.extend({ render: function(template) { - if(!this.model) return; - - /* first unbind all */ - if(this.$nextButton) this.$nextButton.unbind(); - if(this.$prevButton) this.$prevButton.unbind(); - if(this.$jumpButton) this.$jumpButton.unbind(); - if(this.$pageInput) this.$pageInput.unbind(); - - if(this.$zoomInButton) this.$zoomInButton.unbind(); - if(this.$zoomOutButton) this.$zoomOutButton.unbind(); - if(this.$zoomResetButton) this.$zoomResetButton.unbind(); - + if(!this.model) return; + + /* first unbind all */ + if(this.$nextButton) this.$nextButton.unbind(); + if(this.$prevButton) this.$prevButton.unbind(); + if(this.$jumpButton) this.$jumpButton.unbind(); + if(this.$pageInput) this.$pageInput.unbind(); + + if(this.$zoomInButton) this.$zoomInButton.unbind(); + if(this.$zoomOutButton) this.$zoomOutButton.unbind(); + if(this.$zoomResetButton) this.$zoomResetButton.unbind(); + + if (!template) { /* render */ - this._super(template); - + this._super(); + /* fetch important parts */ this.$pageListRoot = $('.image-gallery-page-list', this.element); this.$pages = $('.image-gallery-page-container', this.$pageListRoot); @@ -258,6 +259,9 @@ var ImageGalleryView = View.extend({ this.gotoPage(this.currentPage); this.changePageZoom(this.pageZoom); + } else { + this._super(template); + } }, jumpToPage: function() {