summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-02-11 20:00:35 +0200
committerAlon Levy <alon@pobox.com>2015-02-11 20:00:37 +0200
commit780766e75b0231520128aa892f5efc45b4bc30fb (patch)
tree3783705e2a217679bb761983028a9fcef94a6550 /src
parent1c1c589b43c2e3baa63281ab4a49eec70c9f9180 (diff)
client/node_info: resize description on show, limit both name & desc to 150
we don't allow moving nor scrolling when property dialog overflows window height, so this is an interim measure at best.
Diffstat (limited to 'src')
-rw-r--r--src/client/view/node_info.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/client/view/node_info.js b/src/client/view/node_info.js
index 343e578b..a0d18501 100644
--- a/src/client/view/node_info.js
+++ b/src/client/view/node_info.js
@@ -18,10 +18,15 @@ function _get_form_data() {
};
}
-function textarea_resize(text)
+function textarea_resize(text, max)
{
+ var height;
text.style.height = 'auto';
- text.style.height = text.scrollHeight + 'px';
+ height = text.scrollHeight;
+ if (max) {
+ height = Math.min(max, height);
+ }
+ text.style.height = height + 'px';
}
$('#edit-node-dialog__delete').click(function(e) {
@@ -64,7 +69,7 @@ function show(d) {
var name_textarea = $('.info').find('#editformname');
name_textarea.val(d.name);
- textarea_resize(name_textarea[0]);
+ textarea_resize(name_textarea[0], 150);
$("#editenddate").datepicker({
inline: true,
@@ -77,7 +82,9 @@ function show(d) {
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
});
- $('#editdescription').val(d.description);
+ var description = $('#editdescription');
+ description.val(d.description);
+ textarea_resize(description[0], 150);
$('#edittype').val(d.type);
$('#editurl').val(d.url);
$('#editstatus').val(d.status);