X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c6939b2a92556332eaab2cbbfd61a0e6798091c7..1ff260641b29888f28d24acb58195ea231207494:/apps/wolnelektury_core/static/js/picture.js diff --git a/apps/wolnelektury_core/static/js/picture.js b/apps/wolnelektury_core/static/js/picture.js index 0840aa5fa..052392a32 100644 --- a/apps/wolnelektury_core/static/js/picture.js +++ b/apps/wolnelektury_core/static/js/picture.js @@ -39,6 +39,7 @@ self.spinner = $("#spinner").progressSpin(); $(original).load(function() { + console.log("loaded original"); self._original_loaded = true; self.spinner.stop(); var cb = self.original_loaded; @@ -80,8 +81,8 @@ return self; }, - natural_size: function() { - var img = this.element.find('img').get(0); + natural_size: function() { + var img = this.element.find('img.original').get(0); return [ img.naturalWidth, img.naturalHeight ] }, @@ -124,7 +125,7 @@ var new_width = ratio * this.initial_size[0]; var new_height = ratio * this.initial_size[1]; var target = { -// 'width': new_width, + 'width': new_width, 'left': Math.max(0, this.initial_position.left - (new_width - this.initial_size[0])/2), @@ -136,7 +137,7 @@ this._zoom = level; this.element.css(target); - this.element.find(".original").width(new_width); + // this.element.animate(target, 1200); // default duration=400 },