From 47322dcd25d6e5294f0774bf528031bece43502d Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 7 Jun 2015 19:14:27 +0200 Subject: [PATCH] started updates --- contrib/html/index.html | 13 ++++++++++--- contrib/html/items/ehp.json | 28 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/contrib/html/index.html b/contrib/html/index.html index 7e4e7d86..5691715f 100644 --- a/contrib/html/index.html +++ b/contrib/html/index.html @@ -116,7 +116,7 @@ jsPlumb.ready(function() { connection.getOverlay("label").setLabel(connection.endpoints[0].getParameter('name')); }; - var addEndpoints = function(divId, anchors, needConnections) { + var addEndpoints = function(divId, anchors, needConnections, needUpdates) { for (var i = 0; i < anchors.length; i++) { var anchor = anchors[i]; var anchUUID = divId + anchor.name; @@ -136,10 +136,15 @@ jsPlumb.ready(function() { if (anchor.hasOwnProperty('connectWith') && needConnections) { needConnections.push(new Array(anchUUID).concat(anchor.connectWith)); // to-circuit, to-endpoint[, item-circuit, item-name[, item-parts]] } - instance.addEndpoint(divId, endpoint, { + var endp = instance.addEndpoint(divId, endpoint, { anchor: anchor.anchor, uuid: anchUUID, parameters:{name:anchor.name, priority:anchor.priority} }); + if (anchor.hasOwnProperty('update') && needUpdates) { + var update = anchor.update; + update.endpoint = endp; + needUpdates.push(update); + } } }; @@ -399,8 +404,9 @@ jsPlumb.ready(function() { } // add endpoints var needConnections = new Array(); + var needUpdates = new Array(); for (var i=0; i