summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-05-04 12:15:53 +0300
committerAlon Levy <alon@pobox.com>2015-05-04 12:20:57 +0300
commite62c519013c8ec47bbc5dc4a6ec6fb8a58fa5d32 (patch)
tree8fdf15c94a716256196a8f82971c03f2bd0f32df /src
parent2e952a264a4b8d1c7f4f762f324dba8f89aca865 (diff)
client/view/item_info: set minimal size on textarea. auto height style not working
Diffstat (limited to 'src')
-rw-r--r--src/client/view/item_info.js8
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)