jsplumb updated to read css conf from the all-inclusive-file

parent 48f3e7fe
......@@ -241,7 +241,7 @@
});
}
function updateNodeStyle(gadget, element_id) {
function updateNodeStyle(gadget, element_id, class_definition) {
// Update node size according to the zoom level
// XXX does nothing for now
var zoom_level = gadget.props.zoom_level * 1.1111,
......@@ -252,6 +252,9 @@
.replace('px', '') * zoom_level + 'px';
element.css(j, new_value);
});
Object.keys(class_definition.css || {}).forEach(function (k) {
element.css(k, class_definition.css[k]);
});
}
// function positionGraph(gadget) {
......@@ -584,7 +587,7 @@
function expandProperties(definition, expanded_class_def, fullSchema) {
console.log("expanding properties");
console.log(definition);
var property, temp1, temp2, i, subProp, temp3;//, coppy;
var property, temp1, temp2, i, subProp, temp3;
for (property in definition.properties) {
if (definition.properties.hasOwnProperty(property)) {
console.log("...");
......@@ -1013,7 +1016,7 @@
);
box.css("top", absolute_position[1]);
box.css("left", absolute_position[0]);
updateNodeStyle(gadget, dom_element_id);
updateNodeStyle(gadget, dom_element_id, class_definition);
draggable(gadget); // XXX make only this element draggable.
// Add some flowchart endpoints
......
......@@ -43,7 +43,7 @@
var _class_object = data.class_definition[key], tool;
// XXX "expand" the json schema "allOF" etc
if (_class_object.allOf) {
if (_class_object.allOf[0].$ref === "#/class_definition/node") {
if (_class_object.allOf[0].$ref === "#/node") {
tool = document.createElement('div');
// XXX maybe allow to configure the class name ?
tool.className = "tool " + key;
......
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