diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-07 15:01:51 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-07 15:03:11 +0200 |
| commit | 80961723894cc535e4d3654053cebb06de4e5195 (patch) | |
| tree | 8ad4b2bd6ce8f54d51617f66ca2af66255119f6c /src/client/view | |
| parent | a823e00e4677be4c9d7bdffbbb6b2fb355c84c48 (diff) | |
client/node_info: hack for y-overflow. creates horizontal bar as well which is ugly
Together with addition of new attributes fixes #357
Diffstat (limited to 'src/client/view')
| -rw-r--r-- | src/client/view/node_info.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/view/node_info.js b/src/client/view/node_info.js index 919dfbf1..9aca84e3 100644 --- a/src/client/view/node_info.js +++ b/src/client/view/node_info.js @@ -163,7 +163,8 @@ function show(_graph, d) { var visible_attributes = model_types.type_attributes(d.type).slice(0), hidden_attributes = _.difference(model_types.all_attributes, visible_attributes), visible_elements, - hidden_elements; + hidden_elements, + max_height; visible_elements = visible_attributes.map(base_element_for_attribute); hidden_elements = hidden_attributes.map(base_element_for_attribute); @@ -179,8 +180,12 @@ function show(_graph, d) { _.each(hidden_elements, function (element) { element.hide(); }); _.each(visible_elements, function (element) { element.show(); }); - $('.info').attr('class', 'info'); - $('.info').addClass('type-' + d.type); // Add a class to distinguish types for css + info.attr('class', 'info'); + info.addClass('type-' + d.type); // Add a class to distinguish types for css + + // hack - should be able to set max-height via css percentage, no? + max_height = $(document.body).innerHeight() - $('.info')[0].getBoundingClientRect().top * 2; + info[0].style['max-height'] = String(max_height) + 'px'; _.each(visible_attributes, function (attr) { var element = edit_element_for_attribute(attr); |
