From a96b7e3fa99e861a11de1146b2db6c96384a4923 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 4 May 2015 12:16:16 +0300 Subject: client/view/item_info: reorder per attribute order --- src/client/view/item_info.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/client') 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() { -- cgit v1.3.1