X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/04b05946ab640eaf9135a73772b704dd41c323e7..fbe38cbbacc776e1533f9adc51f5621d5b8ea77f:/platforma/static/js/views/gallery.js diff --git a/platforma/static/js/views/gallery.js b/platforma/static/js/views/gallery.js old mode 100644 new mode 100755 index d3398ce0..d6844c62 --- a/platforma/static/js/views/gallery.js +++ b/platforma/static/js/views/gallery.js @@ -10,7 +10,8 @@ var ImageGalleryView = View.extend({ init: function(element, model, parent, template) { console.log("init for gallery"); - this._super(element, model, template); + var submodel = model.contentModels['gallery']; + this._super(element, submodel, template); this.parent = parent; console.log("gallery model", this.model); @@ -220,6 +221,8 @@ var ImageGalleryView = View.extend({ { if(!this.model) return; + $('.choose-gallery-button', this.element).unbind(); + /* first unbind all */ if(this.$nextButton) this.$nextButton.unbind(); if(this.$prevButton) this.$prevButton.unbind(); @@ -261,6 +264,12 @@ var ImageGalleryView = View.extend({ this.changePageZoom(this.pageZoom); } else { this._super(template); + + var self = this; + $('.choose-gallery-button', self.element).click(function() { + console.log('CLICK CLICK') + self.model.setGallery($('#id_subpath', self.element).val()); + }); } },