From e62c519013c8ec47bbc5dc4a6ec6fb8a58fa5d32 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 4 May 2015 12:15:53 +0300 Subject: client/view/item_info: set minimal size on textarea. auto height style not working --- src/client/view/item_info.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/client/view') diff --git a/src/client/view/item_info.js b/src/client/view/item_info.js index 56e51932..0167e33b 100644 --- a/src/client/view/item_info.js +++ b/src/client/view/item_info.js @@ -101,14 +101,12 @@ function commit() update_item(item, _get_form_data()); } -function textarea_resize(text, max) +function textarea_resize(text, min, max) { var height; text.style.height = 'auto'; height = text.scrollHeight; - if (max) { - height = Math.min(max, height); - } + height = Math.max(min, Math.min(max, height)); text.style.height = height + 'px'; } @@ -220,7 +218,7 @@ function edit_element_for_attribute(attr) function update_textarea(textarea, value) { textarea.val(value); - textarea_resize(textarea[0], 150); + textarea_resize(textarea[0], 25, 150); } function show(_graph, new_item, new_visible_attributes) -- cgit v1.3.1