diff options
| author | Alon Levy <alon@pobox.com> | 2015-05-04 12:15:53 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-05-04 12:20:57 +0300 |
| commit | e62c519013c8ec47bbc5dc4a6ec6fb8a58fa5d32 (patch) | |
| tree | 8fdf15c94a716256196a8f82971c03f2bd0f32df | |
| parent | 2e952a264a4b8d1c7f4f762f324dba8f89aca865 (diff) | |
client/view/item_info: set minimal size on textarea. auto height style not working
| -rw-r--r-- | src/client/view/item_info.js | 8 |
1 files changed, 3 insertions, 5 deletions
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) |
