diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-05 20:44:24 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-05 20:44:24 +0000 |
commit | 4607c2521ef354302cc11e2add3d9c2dd1fb37d1 (patch) | |
tree | e1a4fd6e286ed0bfc01f74506c7ec7b27cde9589 | |
parent | 6a8daaef5e2df4a98e1f47d4f4107c00c03d9498 (diff) |
Improve the close icon so it doesn't look as much like an envelope.
Also add resizing to the fullsize image if the windo size changes.
-rw-r--r-- | core/images/ico-close.png | bin | 1309 -> 1401 bytes | |||
-rw-r--r-- | core/js/fullsize.js | 17 |
2 files changed, 15 insertions, 2 deletions
diff --git a/core/images/ico-close.png b/core/images/ico-close.png Binary files differindex 444f4872..a70e47d9 100644 --- a/core/images/ico-close.png +++ b/core/images/ico-close.png diff --git a/core/js/fullsize.js b/core/js/fullsize.js index 91e43529..df5bcf19 100644 --- a/core/js/fullsize.js +++ b/core/js/fullsize.js @@ -27,6 +27,17 @@ $(document).ready(function() { $("#gFullsizeOverlay*").remove(); $("#gFullsize").remove(); }); + $(window).resize(function() { + $("#gFullsizeOverlay").width($(document).width()); + $("#gFullsizeOverlay").height($(document).height()); + image_size = _auto_fit(fullsize_detail.width, fullsize_detail.height); + $("#gFullsize").height(image_size.height); + $("#gFullsize").width(image_size.width); + $("#gFullsize").css("top", image_size.top); + $("#gFullsize").css("left", image_size.left); + $("#gFullSizeImage").height(image_size.height); + $("#gFullSizeImage").width(image_size.width); + }); }); }); @@ -52,6 +63,8 @@ function _auto_fit(imageWidth, imageHeight) { imageHeight *= ratio; } - return {top: (windowHeight - imageHeight) / 2, left: (windowWidth - imageWidth) / 2, - width: imageWidth, height: imageHeight}; + // handle the case where the calculation is almost zero (2.14e-14) + return {top: ((windowHeight - imageHeight) / 2).toFixed(2), + left: ((windowWidth - imageWidth) / 2).toFixed(2), + width: imageWidth.toFixed(2), height: imageHeight.toFixed(2)}; } |