Commit 06a082d6 authored by Jérome Perrin's avatar Jérome Perrin

do not fail when loading a json with unknown _classes

(not sure if it's a good idea)
parent 51ec5791
......@@ -90,7 +90,8 @@
var node_id = that.getNodeId(element_id);
$("#dialog-fieldset").children().remove();
var element_type = node_dict[node_id]._class.replace('.', '-');
var property_list = configuration[element_type].property_list || [];
var property_list = (configuration[element_type] || {}).property_list || [];
property_list.push({"_class": "Dream.Property", "id": "_class"});
fieldset.append(
'<label>ID</label><input type="text" name="id" id="id" value="' +
......@@ -200,9 +201,8 @@
$("#dialog-form").dialog("open");
});
// Store default values
var data = {}, property_list = configuration[element_type][
"property_list"
] || [];
var data = {},
property_list = (configuration[element_type] || {} ) ["property_list"] || [];
var updateDefaultData = function (data, property_list) {
$.each(property_list, function (idx, value) {
if (value) {
......
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