another fix for beta
[redakcja.git] / redakcja / static / js / wiki / view_gallery.js
index 4b74b3e..65a716a 100644 (file)
@@ -55,7 +55,8 @@
 
             this.dimensions = {};
             this.zoomFactor = 1;
 
             this.dimensions = {};
             this.zoomFactor = 1;
-            this.config().page = CurrentDocument.galleryStart;
+           if (this.config().page == undefined)
+               this.config().page = CurrentDocument.galleryStart;
             this.$element = $("#side-gallery");
             this.$numberInput = $('.page-number', this.$element);
 
             this.$element = $("#side-gallery");
             this.$numberInput = $('.page-number', this.$element);
 
                 self.setPage($(this).val());
             });
                     
                 self.setPage($(this).val());
             });
                     
+           $('.start-page', this.$element).click(function(){
+               self.setPage(CurrentDocument.galleryStart);
+           });
+
             $('.previous-page', this.$element).click(function(){
                 self.setPage(parseInt(self.$numberInput.val(),10) - 1);
             });
             $('.previous-page', this.$element).click(function(){
                 self.setPage(parseInt(self.$numberInput.val(),10) - 1);
             });