reverted Post.resize_image to original
This commit is contained in:
parent
a04e2e590c
commit
248d95a4a0
@ -751,24 +751,24 @@ Post = {
|
||||
|
||||
resize_image: function() {
|
||||
var img = $("image");
|
||||
var large_width = (img.naturalWidth == img.readAttribute('large_width')) ? img.readAttribute('large_width') : img.naturalWidth;
|
||||
var large_height = (img.naturalHeight == img.readAttribute('large_height')) ? img.readAttribute('large_height') : img.naturalHeight;
|
||||
|
||||
|
||||
if(img.original_width == null)
|
||||
{
|
||||
img.original_width = img.width;
|
||||
img.original_height = img.height;
|
||||
}
|
||||
|
||||
var ratio = 1;
|
||||
if ((img.scale_factor == 1) || (img.scale_factor == null)) {
|
||||
/* Use clientWidth for sizing the width, and the window height for the height.
|
||||
* This prevents needing to scroll horizontally to center the image. */
|
||||
var client_width = $("right-col").clientWidth - 15;
|
||||
var client_height = window.innerHeight - 15;
|
||||
// if (img.width > img.height) {
|
||||
ratio = Math.min(ratio, client_width / large_width);
|
||||
ratio = Math.min(ratio, client_height / large_height);
|
||||
// } else {
|
||||
// ratio = Math.min(ratio, client_width / img.large_width);
|
||||
// }
|
||||
ratio = Math.min(ratio, client_width / img.original_width);
|
||||
ratio = Math.min(ratio, client_height / img.original_height);
|
||||
}
|
||||
img.width = large_width * ratio;
|
||||
img.height = large_height * ratio;
|
||||
img.width = img.original_width * ratio;
|
||||
img.height = img.original_height * ratio;
|
||||
img.scale_factor = ratio;
|
||||
|
||||
if (window.Note) {
|
||||
|
Reference in New Issue
Block a user