From 0764c1a45c8db4507415b06170785d2adf12bdac Mon Sep 17 00:00:00 2001 From: Toks Date: Wed, 31 Jul 2013 19:14:30 -0400 Subject: [PATCH] #1875: Auto-resize upload preview to 100% --- app/assets/javascripts/posts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index e5cda5df8..514ac268f 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -92,6 +92,10 @@ $tag_string.css({"resize": "vertical", "width": "100%"}); $tag_string.focus().selectEnd().height($tag_string[0].scrollHeight); + + var $image = $("#c-uploads .ui-wrapper #image, #c-uploads .ui-wrapper:has(#image)"); + $image.height($image.resizable("option", "maxHeight")); + $image.width($image.resizable("option", "maxWidth")); } Danbooru.Post.close_edit_dialog = function(e, ui) {