reverted Post.resize_image to original
This commit is contained in:
parent
a04e2e590c
commit
248d95a4a0
@ -751,8 +751,12 @@ Post = {
|
|||||||
|
|
||||||
resize_image: function() {
|
resize_image: function() {
|
||||||
var img = $("image");
|
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;
|
var ratio = 1;
|
||||||
if ((img.scale_factor == 1) || (img.scale_factor == null)) {
|
if ((img.scale_factor == 1) || (img.scale_factor == null)) {
|
||||||
@ -760,15 +764,11 @@ Post = {
|
|||||||
* This prevents needing to scroll horizontally to center the image. */
|
* This prevents needing to scroll horizontally to center the image. */
|
||||||
var client_width = $("right-col").clientWidth - 15;
|
var client_width = $("right-col").clientWidth - 15;
|
||||||
var client_height = window.innerHeight - 15;
|
var client_height = window.innerHeight - 15;
|
||||||
// if (img.width > img.height) {
|
ratio = Math.min(ratio, client_width / img.original_width);
|
||||||
ratio = Math.min(ratio, client_width / large_width);
|
ratio = Math.min(ratio, client_height / img.original_height);
|
||||||
ratio = Math.min(ratio, client_height / large_height);
|
|
||||||
// } else {
|
|
||||||
// ratio = Math.min(ratio, client_width / img.large_width);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
img.width = large_width * ratio;
|
img.width = img.original_width * ratio;
|
||||||
img.height = large_height * ratio;
|
img.height = img.original_height * ratio;
|
||||||
img.scale_factor = ratio;
|
img.scale_factor = ratio;
|
||||||
|
|
||||||
if (window.Note) {
|
if (window.Note) {
|
||||||
|
Reference in New Issue
Block a user