aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2011-07-11 15:28:18 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2011-07-11 15:28:18 -0400
commit291dba972fa31886742cb11bacab440ba8202668 (patch)
treec06a61c24cc64730012bf60a3d6dbf1a1ab2ecb1 /web/js
parentAdd more exif types, thanks to the imageinfo javascript plugin in some random google chrome demo extension. (diff)
downloadPhotoFloat-291dba972fa31886742cb11bacab440ba8202668.tar.xz
PhotoFloat-291dba972fa31886742cb11bacab440ba8202668.zip
Store ratio for determining stretch direction.
Diffstat (limited to 'web/js')
-rw-r--r--web/js/011-display.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/js/011-display.js b/web/js/011-display.js
index acbc9a1..cccf1fc 100644
--- a/web/js/011-display.js
+++ b/web/js/011-display.js
@@ -146,7 +146,7 @@ $(document).ready(function() {
if (image.get(0) === this)
$(window).bind("resize", scaleImage);
container = $("#photo-view");
- if (image.css("width") !== "100%" && container.height() * image.width() / image.height() > container.width())
+ if (image.css("width") !== "100%" && container.height() * image.attr("ratio") > container.width())
image.css("width", "100%").css("height", "auto").css("position", "absolute").css("bottom", 0);
else if (image.css("height") !== "100%")
image.css("height", "100%").css("width", "auto").css("position", "").css("bottom", "");
@@ -166,7 +166,7 @@ $(document).ready(function() {
$(window).unbind("resize", scaleImage);
photoSrc = photoFloat.photoPath(currentAlbum, currentPhoto, maxSize, false);
$("#photo")
- .attr("width", width).attr("height", height)
+ .attr("width", width).attr("height", height).attr("ratio", currentPhoto.size[0] / currentPhoto.size[1])
.attr("src", photoSrc)
.attr("alt", currentPhoto.name)
.attr("title", currentPhoto.date)