potential fix for #1375: The preview image on the upload page is sometimes displayed at full size

This commit is contained in:
r888888888
2015-07-29 17:43:35 -07:00
parent f483d0e7a8
commit 8c57476667

View File

@@ -107,7 +107,7 @@
Danbooru.Upload.initialize_image = function() {
var $image = $("#image");
if ($image.size() > 0) {
if ($image.length) {
var height = $image.height();
var width = $image.width();
if (height > 400) {
@@ -128,6 +128,9 @@
$("#scale").html("Scaled " + parseInt(100 * ratio) + "% (original: " + origin_width + "x" + origin_height + ")");
}
});
} else if (!this.retried) {
this.retried = true;
window.setTimeout(Danbooru.Upload.initialize_image, 200);
}
}
}