Commit 92e53cc1 authored by Klaus Wölfel's avatar Klaus Wölfel

update static version

parent 729f6194
......@@ -117,6 +117,7 @@
edge_data.destination = getNodeId(gadget, connection.targetId);
gadget.props.data.graph.edge[connection.id] = edge_data;
}
checkNodeConstraint(gadget, getNodeId(gadget, connection.targetId));
gadget.notifyDataChanged();
}
function convertToAbsolutePosition(gadget, x, y) {
......@@ -217,6 +218,20 @@
});
gadget.notifyDataChanged();
}
function checkNodeConstraint(gadget, node_id) {
var element_id = gadget.props.node_id_to_dom_element_id[node_id], element = $(gadget.props.element).find("#" + element_id), jsplumb_instance = gadget.props.jsplumb_instance, node_class = gadget.props.data.graph.node[node_id]._class;
if (jsplumb_instance.getConnections({
target: element_id
}).length === 0 && node_class.toLowerCase().search("source") === -1) {
var warning = $("<div></div>").attr({
"class": "alert_no_input ui-btn-icon-notext ui-icon-alert",
title: "No input defined!"
});
element.append(warning);
} else {
element.find(".alert_no_input").remove();
}
}
function updateElementData(gadget, node_id, data) {
var element_id = gadget.props.node_id_to_dom_element_id[node_id], new_id = data.id;
if (data.data.name) {
......@@ -640,6 +655,9 @@
$.each(this.props.data.graph.edge, function(key, value) {
addEdge(gadget, key, value);
});
$.each(this.props.data.graph.node, function(key, value) {
checkNodeConstraint(gadget, key);
});
return RSVP.all([ waitForDrop(gadget), waitForConnection(gadget), waitForConnectionDetached(gadget), waitForConnectionClick(gadget), gadget.props.nodes_click_monitor ]);
});
})(RSVP, rJS, $, jsPlumb, Handlebars, loopEventListener, promiseEventListener, DOMParser);
\ No newline at end of file
This diff is collapsed.
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