From fb842c287652121b4135645c88433a04d4cf5331 Mon Sep 17 00:00:00 2001 From: ZhangRui Date: Thu, 3 Sep 2015 16:45:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/gallery.js | 5 ++--- src/gallery.coffee | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/gallery.js b/lib/gallery.js index 9a1772f..ffbe5c3 100644 --- a/lib/gallery.js +++ b/lib/gallery.js @@ -203,7 +203,7 @@ Gallery = (function(superClass) { }; Gallery.prototype._renderImage = function() { - var $win, fitSize, originSize, showZoom, stageSize, thumbImg; + var $win, originSize, showZoom, stageSize, thumbImg; if (!this.gallery) { return; } @@ -215,8 +215,7 @@ Gallery = (function(superClass) { height: $win.height() - 90 }; showZoom = this.curOriginSize.width > stageSize.width || this.curOriginSize.height > stageSize.height; - fitSize = this._fitSize(stageSize, this.curOriginSize); - this.gallery.css(fitSize); + this.gallery.css(this._fitSize(stageSize, this.curOriginSize)); this.img.attr('src', thumbImg.src); if (showZoom) { this.zoom_in = this.wrapper.find('.zoom-in'); diff --git a/src/gallery.coffee b/src/gallery.coffee index b58e307..231065c 100644 --- a/src/gallery.coffee +++ b/src/gallery.coffee @@ -191,9 +191,7 @@ class Gallery extends SimpleModule height: $win.height() - 90 showZoom = @curOriginSize.width > stageSize.width or @curOriginSize.height > stageSize.height - fitSize = @_fitSize stageSize, @curOriginSize - - @gallery.css fitSize + @gallery.css @_fitSize stageSize, @curOriginSize @img.attr('src', thumbImg.src) if showZoom