diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-22 07:31:00 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-22 07:31:00 -0700 |
commit | 78cce555c377b4dd3078a007c6c407cf4eb9f6dd (patch) | |
tree | b9df39559eb59eb86d32cdaff390d3a2797d1387 | |
parent | bf93473de529fc20ecb774e4f1ef5ca521f6a3b0 (diff) |
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
-rw-r--r-- | lib/gallery.show_full_size.js | 11 |
1 files changed, 10 insertions, 1 deletions
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;"> </div>'); - 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('<div id="gFullsize" class="ui-dialog ui-widget" ' + 'style="overflow: hidden; display: block; ' + |