resolve clashing variable name for connection and nf.Connection. This closes
'nf.Dialog',
'nf.Client',
'nf.ErrorHandler'],
- function ($, d3, connection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
- return (nf.Draggable = factory($, d3, connection, birdseye, canvasUtils, common, dialog, client, errorHandler));
+ function ($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
+ return (nf.Draggable = factory($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Draggable =
root.nf.Client,
root.nf.ErrorHandler);
}
-}(this, function ($, d3, connection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
+}(this, function ($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
'use strict';
var nfCanvas;
// go through each selected component
selectedComponents.each(function (d) {
// consider any self looping connections
- var connections = connection.getComponentConnections(d.id);
+ var connections = nfConnection.getComponentConnections(d.id);
$.each(connections, function (_, connection) {
if (!updates.has(connection.id) && canvasUtils.getConnectionSourceComponentId(connection) === canvasUtils.getConnectionDestinationComponentId(connection)) {
- var connectionUpdate = nfDraggable.updateConnectionPosition(connection.get(connection.id), delta);
+ var connectionUpdate = nfDraggable.updateConnectionPosition(nfConnection.get(connection.id), delta);
if (connectionUpdate !== null) {
updates.set(connection.id, connectionUpdate);
}
contentType: 'application/json'
}).done(function (response) {
// update the component
- connection.set(response);
+ nfConnection.set(response);
// resolve with an object so we can refresh when finished
deferred.resolve({
* @param updates
*/
refreshConnections: function (updates) {
+ if (updates.size() > 0) {
// wait for all updates to complete
$.when.apply(window, updates.values()).done(function () {
var dragged = $.makeArray(arguments);
connections.add(component.id);
} else {
// get connections that need to be refreshed because its attached to this component
- var componentConnections = connection.getComponentConnections(component.id);
+ var componentConnections = nfConnection.getComponentConnections(component.id);
$.each(componentConnections, function (_, connection) {
connections.add(connection.id);
});
// refresh the connections
connections.forEach(function (connectionId) {
- connection.refresh(connectionId);
+ nfConnection.refresh(connectionId);
});
}).always(function () {
birdseye.refresh();
});
+ }
},
/**
