X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d64a8451dafc98e8f71455a55d123d22f3368ef9..36f6233fd79390ad5af8a1532eac60a0ae57c825:/platforma/static/js/wiki/view_gallery.js?ds=sidebyside diff --git a/platforma/static/js/wiki/view_gallery.js b/platforma/static/js/wiki/view_gallery.js index 69761ca3..aa39e15f 100644 --- a/platforma/static/js/wiki/view_gallery.js +++ b/platforma/static/js/wiki/view_gallery.js @@ -44,6 +44,8 @@ function ScanGalleryPerspective(options){ var old_callback = options.callback || function() { }; + this.noupdate_hash_onenter = true; + options.callback = function(){ var self = this; @@ -92,6 +94,8 @@ self.imageMoveStart.apply(self, arguments); }); + + old_callback.call(this); }; @@ -136,6 +140,7 @@ ScanGalleryPerspective.prototype.setPage = function(newPage){ 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]); }; @@ -222,7 +227,8 @@ this.doc.refreshGallery({ success: function(doc, data){ self.$image.show(); - self.setPage( self.$numberInput.val() ); + console.log("gconfig:", self.config().page ); + self.setPage( self.config().page ); $('.error_message', self.$element).hide(); if(success) success(); @@ -233,8 +239,13 @@ if(failure) failure(); } }); + }; + ScanGalleryPerspective.prototype.onExit = function(success, failure) { + + }; + $.wiki.ScanGalleryPerspective = ScanGalleryPerspective; })(jQuery); \ No newline at end of file