Commit 28ea94db authored by Jérome Perrin's avatar Jérome Perrin

fix a problem with machine

It was not possible to add a machine
parent cd145a03
...@@ -183,13 +183,15 @@ ...@@ -183,13 +183,15 @@
var data = {}, property_list = configuration[element_prefix]["property_list"] || []; var data = {}, property_list = configuration[element_prefix]["property_list"] || [];
var updateDefaultData = function(data, property_list) { var updateDefaultData = function(data, property_list) {
$.each(property_list, function(key, element) { $.each(property_list, function(key, element) {
if(element._class === "Dream.Property") { if (element) {
data[element.id] = element.default; if(element._class === "Dream.Property") {
} else if (element._class === "Dream.PropertyList") { data[element.id] = element.default;
data[element.id] = {}; } else if (element._class === "Dream.PropertyList") {
var next_data = data[element.id]; data[element.id] = {};
var next_property_list = element.property_list || []; var next_data = data[element.id];
updateDefaultData(next_data, next_property_list); var next_property_list = element.property_list || [];
updateDefaultData(next_data, next_property_list);
}
} }
}); });
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment