Fixes for inserting footnotes, references.
[redakcja.git] / src / redakcja / static / js / wiki / view_gallery.js
index 65a716a..5152f43 100644 (file)
@@ -47,7 +47,6 @@
     function ScanGalleryPerspective(options){
         var old_callback = options.callback || function() { };
 
-               this.noupdate_hash_onenter = true;
         this.vsplitbar = 'GALERIA';
 
         options.callback = function(){
                        old_callback.call(this);
         };
 
-        $.wiki.Perspective.call(this, options);
+        $.wiki.SidebarPerspective.call(this, options);
     };
 
-    ScanGalleryPerspective.prototype = new $.wiki.Perspective();
+    ScanGalleryPerspective.prototype = new $.wiki.SidebarPerspective();
 
     ScanGalleryPerspective.prototype._resizeImage = function(){
         var $img = this.$image;
         newPage = normalizeNumber(newPage, this.doc.galleryImages.length);
         this.$numberInput.val(newPage);
                this.config().page = newPage;
-        $('.gallery-image img', this.$element).attr('src', this.doc.galleryImages[newPage - 1]);
+        $('.gallery-image img', this.$element).attr('src', this.doc.galleryImages[newPage - 1].url);
     };
 
     ScanGalleryPerspective.prototype.alterZoom = function(delta){
      * Loading gallery
      */
     ScanGalleryPerspective.prototype.onEnter = function(success, failure){
-        var self = this;
+        $.wiki.SidebarPerspective.prototype.onEnter.call(this);
 
-        $.wiki.Perspective.prototype.onEnter.call(this);
+        var self = this;
 
-        $('.vsplitbar').not('.active').trigger('click');
-        $(".vsplitbar-title").html("↓ GALERIA ↓");        
-        
         this.doc.refreshGallery({
             success: function(doc, data){
                 self.$image.show();