summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-05-04 12:16:16 +0300
committerAlon Levy <alon@pobox.com>2015-05-04 12:20:57 +0300
commita96b7e3fa99e861a11de1146b2db6c96384a4923 (patch)
tree7cdc9580206fa4162637ea50e3f33bb3880581db /src/client
parente62c519013c8ec47bbc5dc4a6ec6fb8a58fa5d32 (diff)
client/view/item_info: reorder per attribute order
Diffstat (limited to 'src/client')
-rw-r--r--src/client/view/item_info.js5
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() {