Bit nicer source flow.
[redakcja.git] / src / redakcja / static / js / wiki / view_gallery.js
index 64bb46f..c238ebf 100644 (file)
         }
 
         setPage(newPage) {
         }
 
         setPage(newPage) {
-            newPage = normalizeNumber(newPage, this.doc.galleryImages.length);
+            newPage = normalizeNumber(newPage, this.galleryImages.length);
             this.$numberInput.val(newPage);
             this.config().page = newPage;
             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) {
         }
 
         alterZoom(delta) {
          */
         refreshGallery(success, failure) {
             var self = this;
          */
         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 );
                     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();
                 },
 
                     $('.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();
                     self.$image.hide();
                     $('.error_message', self.$element).show().html(message);
                     if(failure) failure();