fix adding document bug
[redakcja.git] / redakcja / static / js / wiki / view_gallery.js
index aa39e15..ec486bc 100644 (file)
@@ -65,7 +65,7 @@
                 event.preventDefault();
                 self.setPage($(this).val());
             });
                 event.preventDefault();
                 self.setPage($(this).val());
             });
-
+                    
             $('.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);
             });
 
     ScanGalleryPerspective.prototype.setPage = function(newPage){
         newPage = normalizeNumber(newPage, this.doc.galleryImages.length);
 
     ScanGalleryPerspective.prototype.setPage = function(newPage){
         newPage = normalizeNumber(newPage, this.doc.galleryImages.length);
+        $('#imagesCount').html("/"+this.doc.galleryImages.length);
         this.$numberInput.val(newPage);
                this.config().page = newPage;
         $('.gallery-image img', this.$element).attr('src', this.doc.galleryImages[newPage - 1]);
         this.$numberInput.val(newPage);
                this.config().page = newPage;
         $('.gallery-image img', this.$element).attr('src', this.doc.galleryImages[newPage - 1]);
 
         $.wiki.Perspective.prototype.onEnter.call(this);
 
 
         $.wiki.Perspective.prototype.onEnter.call(this);
 
+        $('.vsplitbar').not('.active').trigger('click');
+
         this.doc.refreshGallery({
             success: function(doc, data){
                 self.$image.show();
         this.doc.refreshGallery({
             success: function(doc, data){
                 self.$image.show();
 
     $.wiki.ScanGalleryPerspective = ScanGalleryPerspective;
 
 
     $.wiki.ScanGalleryPerspective = ScanGalleryPerspective;
 
-})(jQuery);
\ No newline at end of file
+})(jQuery);