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

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