X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/e6c778f6e92e584815a14d3e6a31a03a5e2ab7e1..e0f595e44766e352edfce0aaf5d32be57f448882:/src/redakcja/static/js/wiki/view_gallery.js diff --git a/src/redakcja/static/js/wiki/view_gallery.js b/src/redakcja/static/js/wiki/view_gallery.js index 64bb46f1..c238ebfd 100644 --- a/src/redakcja/static/js/wiki/view_gallery.js +++ b/src/redakcja/static/js/wiki/view_gallery.js @@ -186,10 +186,10 @@ } setPage(newPage) { - newPage = normalizeNumber(newPage, this.doc.galleryImages.length); + newPage = normalizeNumber(newPage, this.galleryImages.length); this.$numberInput.val(newPage); this.config().page = newPage; - $('.gallery-image img', this.$element).attr('src', this.doc.galleryImages[newPage - 1].url); + $('.gallery-image img', this.$element).attr('src', this.galleryImages[newPage - 1].url); } alterZoom(delta) { @@ -262,17 +262,19 @@ */ refreshGallery(success, failure) { var self = this; - this.doc.refreshGallery({ - success: function(doc, data){ + this.doc.refreshScansGallery({ + + success: function(galleryImages) { + self.galleryImages = galleryImages; self.$image.show(); console.log("gconfig:", self.config().page ); self.setPage( self.config().page ); - $('#imagesCount').html("/" + doc.galleryImages.length); + $('#imagesCount').html("/" + galleryImages.length); $('.error_message', self.$element).hide(); if(success) success(); }, - failure: function(doc, message){ + failure: function(message) { self.$image.hide(); $('.error_message', self.$element).show().html(message); if(failure) failure();