From 78cce555c377b4dd3078a007c6c407cf4eb9f6dd Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 22 Sep 2009 07:31:00 -0700 Subject: Change the gallery.show_full_size widget to only scale the image if one of the dimensions is greater than the browser window size. Fixes #695 --- lib/gallery.show_full_size.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js index 7e826c32..360ecdc2 100644 --- a/lib/gallery.show_full_size.js +++ b/lib/gallery.show_full_size.js @@ -15,7 +15,16 @@ '-moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; ' + '-moz-background-inline-policy: -moz-initial; z-index: 1001;"> '); - var image_size = $.gallery_auto_fit_window(image_width, image_height); + var image_size; + if (image_width >= size.width() - 6 || image_height >= size.height() - 6) { + image_size = $.gallery_auto_fit_window(image_width, image_height); + } else { + image_size = { + top: Number((height - image_height) / 2), left: Number((width - image_width) / 2), + width: Number(image_width), height: Number(image_height) + }; + } + $("body").append('