diff options
| author | Alon Levy <alon@pobox.com> | 2015-05-04 12:16:16 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-05-04 12:20:57 +0300 |
| commit | a96b7e3fa99e861a11de1146b2db6c96384a4923 (patch) | |
| tree | 7cdc9580206fa4162637ea50e3f33bb3880581db /src/client | |
| parent | e62c519013c8ec47bbc5dc4a6ec6fb8a58fa5d32 (diff) | |
client/view/item_info: reorder per attribute order
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/view/item_info.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/view/item_info.js b/src/client/view/item_info.js index 0167e33b..1dc1062d 100644 --- a/src/client/view/item_info.js +++ b/src/client/view/item_info.js @@ -227,7 +227,7 @@ function show(_graph, new_item, new_visible_attributes) visible_elements, hidden_elements; - visible_attributes = new_visible_attributes || model_types.type_attributes(new_item.type).slice(0); + visible_attributes = (new_visible_attributes || model_types.type_attributes(new_item.type)).slice(0).reverse(); hidden_attributes = _.difference(model_types.all_attributes, visible_attributes), visible_elements = visible_attributes.map(base_element_for_attribute); hidden_elements = hidden_attributes.map(base_element_for_attribute); @@ -244,11 +244,11 @@ function show(_graph, new_item, new_visible_attributes) info_container.attr('class', 'info-container'); // clear previous type-x css classes info_container.addClass('type-' + item.type); // add css type class - info_container.show(); _.each(visible_attributes, function (attr) { var element = edit_element_for_attribute(attr); value = item[attr]; + element.parent().insertBefore(element.parent().parent().children().first()); switch (attr) { case 'enddate': case 'startdate': @@ -278,6 +278,7 @@ function show(_graph, new_item, new_visible_attributes) element.val(value); } }); + info_container.show(); } function init() { |
