fieldset; correction needed after rebase

parent e01fe793
/*global rJS, RSVP, jQuery, Handlebars, /*global rJS, RSVP, jQuery, Handlebars,
promiseEventListener, initGadgetMixin*/ promiseEventListener, initGadgetMixin, console */
/*jslint nomen: true */ /*jslint nomen: true */
(function (window, rJS, RSVP, Handlebars, initGadgetMixin) { (function (window, rJS, RSVP, Handlebars, initGadgetMixin) {
"use strict"; "use strict";
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
delete property_definition.allOf[0].type; delete property_definition.allOf[0].type;
} }
return gadget.declareGadget("../expandable_field/index.html"); return gadget.declareGadget("../expandable_field/index.html");
}
if (property_definition.type === "object") { if (property_definition.type === "object") {
// Create a recursive fieldset for this key. // Create a recursive fieldset for this key.
return gadget.declareGadget("../fieldset/index.html"); return gadget.declareGadget("../fieldset/index.html");
...@@ -89,46 +90,42 @@ ...@@ -89,46 +90,42 @@
if (node_id) { if (node_id) {
addField('id', {'type': 'string'}, node_id); addField('id', {'type': 'string'}, node_id);
} }
Object.keys(options.property_definition.properties Object.keys(options.property_definition.properties)
).forEach(function (property_name) { .forEach(function (property_name) {
var property_definition = var property_definition =
options.property_definition.properties[property_name], options.property_definition.properties[property_name],
value = property_definition.default, value = property_definition.default,
i=0, property; i=0, property;
// XXX some properties are not editable if (property_definition.allOf) {
if (property_name !== 'coordinate' && property_name !== '_class') { if (property_definition.allOf[0].properties) {
addField(property_name, property_definition, value); for (property in property_definition
if (property_definition.allOf) { .allOf[0].properties) {
if (property_definition.allOf[0].properties) { if (property_definition.allOf[0]
for (property in property_definition .properties.hasOwnProperty(property)) {
.allOf[0].properties) { i += 1;
if (property_definition.allOf[0].properties if (i > 1) {console.log("something is wrong!");}
.hasOwnProperty(property)) { value = property_definition.allOf[0]
i += 1; .properties[property].default;
if (i > 1) {console.log("something is wrong!");} }
value = property_definition.allOf[0]
.properties[property].default;
} }
} }
} }
} console.log("TRYING TO FIND A VALUE!!!!");
console.log("TRYING TO FIND A VALUE!!!!"); console.log(options);
console.log(options); console.log(options.value);
console.log(options.value); console.log(property_name);
console.log(property_name); value = (options.value || {})[property_name] === undefined
value = (options.value || {})[property_name] === undefined ? value : options.value[property_name];
? value : options.value[property_name]; if (property_name !== 'coordinate'
if (property_name !== 'coordinate' && property_name !== '_class'
&& property_name !== '_class' && property_name !== 'id') {
&& property_name !== 'id') { console.log("ADDING FIELD FOR " + property_name + "!!!!!!!");
console.log("ADDING FIELD FOR " + property_name + "!!!!!!!"); addField(property_name, property_definition, value);
addField(property_name, property_definition, value); }
} });
});
}); });
return queue; return queue;
}) })
// getContent of all subfields // getContent of all subfields
.declareMethod("getContent", function () { .declareMethod("getContent", function () {
console.log("GET CONTENT SIMPLE FIELDSET"); console.log("GET CONTENT SIMPLE FIELDSET");
......
...@@ -596,7 +596,9 @@ ...@@ -596,7 +596,9 @@
gadget.props.data.class_definition[node_data._class], gadget.props.data.class_definition[node_data._class],
gadget.props.data gadget.props.data
); );
console.log("----schema----");
console.log(schema);
console.log("----schema----");
if (node_edit_popup.length !== 0) { if (node_edit_popup.length !== 0) {
node_edit_popup.remove(); node_edit_popup.remove();
} }
...@@ -606,7 +608,6 @@ ...@@ -606,7 +608,6 @@
); );
node_edit_popup = $(gadget.props.element).find('#edit-popup'); node_edit_popup = $(gadget.props.element).find('#edit-popup');
console.log("openNODEDIALOG 1.3"); console.log("openNODEDIALOG 1.3");
console.log("openNODEDIALOG 1.35");
console.log(node_edit_popup); console.log(node_edit_popup);
console.log(node_edit_popup.find(".node_class")); console.log(node_edit_popup.find(".node_class"));
console.log(gadget.props.data.graph.node); console.log(gadget.props.data.graph.node);
......
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