Commit 906063be authored by Sebastien Robin's avatar Sebastien Robin

upgrade jsPlumb to version 1.4.1

parent a601a0dc
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......@@ -47,6 +47,7 @@
* removeClass removes a class from a given element.
* removeElement removes some element completely from the DOM.
* setAttribute sets an attribute on some element.
* setDragFilter sets a filter for some element that indicates areas of the element that should not respond to dragging.
* setDraggable sets whether or not some element should be draggable.
* setDragScope sets the drag scope for a given element.
* setOffset sets the offset of some element.
......@@ -57,13 +58,17 @@
//var getBoundingClientRectSupported = "getBoundingClientRect" in document.documentElement;
var _getElementObject = function(el) {
return typeof(el) == "string" ? $("#" + el) : $(el);
};
jsPlumb.CurrentLibrary = {
/**
* adds the given class to the element object.
*/
addClass : function(el, clazz) {
el = jsPlumb.CurrentLibrary.getElementObject(el);
el = _getElementObject(el);
try {
if (el[0].className.constructor == SVGAnimatedString) {
jsPlumbUtil.svg.addClass(el[0], clazz);
......@@ -91,7 +96,7 @@
* appends the given child to the given parent.
*/
appendElement : function(child, parent) {
jsPlumb.CurrentLibrary.getElementObject(parent).append(child);
_getElementObject(parent).append(child);
},
/**
......@@ -108,7 +113,7 @@
* uses 'on'.
*/
bind : function(el, event, callback) {
el = jsPlumb.CurrentLibrary.getElementObject(el);
el = _getElementObject(el);
el.bind(event, callback);
},
......@@ -177,9 +182,7 @@
* function is used to find the element, using the given String as the element's id.
*
*/
getElementObject : function(el) {
return typeof(el) == "string" ? $("#" + el) : $(el);
},
getElementObject : _getElementObject,
/**
* gets the offset for the element object. this should return a js object like this:
......@@ -199,7 +202,7 @@
},
getParent : function(el) {
return jsPlumb.CurrentLibrary.getElementObject(el).parent();
return _getElementObject(el).parent();
},
getScrollLeft : function(el) {
......@@ -212,7 +215,7 @@
getSelector : function(context, spec) {
if (arguments.length == 2)
return jsPlumb.CurrentLibrary.getElementObject(context).find(spec);
return _getElementObject(context).find(spec);
else
return $(context);
},
......@@ -225,7 +228,7 @@
},
getTagName : function(el) {
var e = jsPlumb.CurrentLibrary.getElementObject(el);
var e = _getElementObject(el);
return e.length > 0 ? e[0].tagName : null;
},
......@@ -272,8 +275,39 @@
/**
* initialises the given element to be draggable.
*/
initDraggable : function(el, options, isPlumbedComponent) {
initDraggable : function(el, options, isPlumbedComponent, _jsPlumb) {
options = options || {};
/*
// css3 transforms
// http://gungfoo.wordpress.com/2013/02/15/jquery-ui-resizabledraggable-with-transform-scale-set/
options.start = _jsPlumb.wrap(options["start"], function(e, ui) {
// TODO why is this 0?
ui.position.left = 0;
ui.position.top = 0;
});
options.drag = _jsPlumb.wrap(options["drag"], function(e, ui) {
console.log("original", ui.originalPosition.left, ui.originalPosition.top);
console.log("current", ui.position.left, ui.position.top);
//var changeLeft = ui.position.left - ui.originalPosition.left; // find change in left
//var newLeft = ui.originalPosition.left + (changeLeft * _jsPlumb.getZoom()); // adjust new left by our zoomScale
//var changeTop = ui.position.top - ui.originalPosition.top; // find change in top
//var newTop = ui.originalPosition.top + (changeTop * _jsPlumb.getZoom()); // adjust new top by our zoomScale
//ui.position.left = newLeft;
//ui.position.top = newTop;
ui.position.left *= _jsPlumb.getZoom();
ui.position.top *= _jsPlumb.getZoom();
});
*/
// remove helper directive if present and no override
if (!options.doNotRemoveHelper)
options.helper = null;
......@@ -291,8 +325,7 @@
},
isAlreadyDraggable : function(el) {
el = jsPlumb.CurrentLibrary.getElementObject(el);
return el.hasClass("ui-draggable");
return _getElementObject(el).hasClass("ui-draggable");
},
/**
......@@ -313,7 +346,7 @@
* removes the given class from the element object.
*/
removeClass : function(el, clazz) {
el = jsPlumb.CurrentLibrary.getElementObject(el);
el = _getElementObject(el);
try {
if (el[0].className.constructor == SVGAnimatedString) {
jsPlumbUtil.svg.removeClass(el[0], clazz);
......@@ -327,34 +360,28 @@
},
removeElement : function(element) {
jsPlumb.CurrentLibrary.getElementObject(element).remove();
_getElementObject(element).remove();
},
/**
* sets the named attribute on the given element object.
*/
setAttribute : function(el, attName, attValue) {
el.attr(attName, attValue);
},
setDragFilter : function(el, filter) {
if (jsPlumb.CurrentLibrary.isAlreadyDraggable(el))
el.draggable("option", "cancel", filter);
},
/**
* sets the draggable state for the given element
*/
setDraggable : function(el, draggable) {
el.draggable("option", "disabled", !draggable);
},
/**
* sets the drag scope. probably time for a setDragOption method (roll this and the one above together)
* @param el
* @param scope
*/
setDragScope : function(el, scope) {
el.draggable("option", "scope", scope);
},
setOffset : function(el, o) {
jsPlumb.CurrentLibrary.getElementObject(el).offset(o);
_getElementObject(el).offset(o);
},
/**
......@@ -366,19 +393,12 @@
* @param originalEvent
*/
trigger : function(el, event, originalEvent) {
//originalEvent.stopPropagation();
//jsPlumb.CurrentLibrary.getElementObject(el).trigger(originalEvent);
var h = jQuery._data(jsPlumb.CurrentLibrary.getElementObject(el)[0], "handle");
var h = jQuery._data(_getElementObject(el)[0], "handle");
h(originalEvent);
//originalEvent.stopPropagation();
},
/**
* event unbinding wrapper. it just so happens that jQuery uses 'unbind' also. yui3, for example,
* uses..something else.
*/
unbind : function(el, event, callback) {
el = jsPlumb.CurrentLibrary.getElementObject(el);
el = _getElementObject(el);
el.unbind(event, callback);
}
};
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -124,13 +124,16 @@
var makeConnector = function(renderMode, connectorName, connectorArgs) {
var c = new Object();
if (!_jsPlumb.Defaults.DoNotThrowErrors && jsPlumb.Connectors[connectorName] == null)
throw { msg:"jsPlumb: unknown connector type '" + connectorName + "'" };
jsPlumb.Connectors[connectorName].apply(c, [connectorArgs]);
jsPlumb.ConnectorRenderers[renderMode].apply(c, [connectorArgs]);
return c;
};
this.setConnector = function(connectorSpec, doNotRepaint) {
if (connector != null) jsPlumbUtil.removeElements(connector.getDisplayElements());
if (connector != null) _ju.removeElements(connector.getDisplayElements());
var connectorArgs = {
_jsPlumb:self._jsPlumb,
parent:params.parent,
......@@ -147,7 +150,7 @@
if (connectorSpec.length == 1)
connector = makeConnector(renderMode, connectorSpec[0], connectorArgs);
else
connector = makeConnector(renderMode, connectorSpec[0], jsPlumbUtil.merge(connectorSpec[1], connectorArgs));
connector = makeConnector(renderMode, connectorSpec[0], _ju.merge(connectorSpec[1], connectorArgs));
}
// binds mouse listeners to the current connector.
self.bindListeners(connector, self, _internalHover);
......@@ -298,30 +301,32 @@
var _suspendedAt = _jsPlumb.getSuspendedAt();
_jsPlumb.updateOffset( { elId : this.sourceId, timestamp:_suspendedAt });
_jsPlumb.updateOffset( { elId : this.targetId, timestamp:_suspendedAt });
// paint the endpoints
var myInfo = _jsPlumb.getCachedData(this.sourceId),
myOffset = myInfo.o, myWH = myInfo.s,
otherInfo = _jsPlumb.getCachedData(this.targetId),
otherOffset = otherInfo.o,
otherWH = otherInfo.s,
initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),
anchorLoc = this.endpoints[0].anchor.compute( {
xy : [ myOffset.left, myOffset.top ], wh : myWH, element : this.endpoints[0],
elementId:this.endpoints[0].elementId,
txy : [ otherOffset.left, otherOffset.top ], twh : otherWH, tElement : this.endpoints[1],
timestamp:initialTimestamp
});
this.endpoints[0].paint( { anchorLoc : anchorLoc, timestamp:initialTimestamp });
if(!_jsPlumb.isSuspendDrawing()) {
// paint the endpoints
var myInfo = _jsPlumb.getCachedData(this.sourceId),
myOffset = myInfo.o, myWH = myInfo.s,
otherInfo = _jsPlumb.getCachedData(this.targetId),
otherOffset = otherInfo.o,
otherWH = otherInfo.s,
initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),
anchorLoc = this.endpoints[0].anchor.compute( {
xy : [ myOffset.left, myOffset.top ], wh : myWH, element : this.endpoints[0],
elementId:this.endpoints[0].elementId,
txy : [ otherOffset.left, otherOffset.top ], twh : otherWH, tElement : this.endpoints[1],
timestamp:initialTimestamp
});
anchorLoc = this.endpoints[1].anchor.compute( {
xy : [ otherOffset.left, otherOffset.top ], wh : otherWH, element : this.endpoints[1],
elementId:this.endpoints[1].elementId,
txy : [ myOffset.left, myOffset.top ], twh : myWH, tElement : this.endpoints[0],
timestamp:initialTimestamp
});
this.endpoints[1].paint({ anchorLoc : anchorLoc, timestamp:initialTimestamp });
this.endpoints[0].paint( { anchorLoc : anchorLoc, timestamp:initialTimestamp });
anchorLoc = this.endpoints[1].anchor.compute( {
xy : [ otherOffset.left, otherOffset.top ], wh : otherWH, element : this.endpoints[1],
elementId:this.endpoints[1].elementId,
txy : [ myOffset.left, myOffset.top ], twh : myWH, tElement : this.endpoints[0],
timestamp:initialTimestamp
});
this.endpoints[1].paint({ anchorLoc : anchorLoc, timestamp:initialTimestamp });
}
// END INITIALISATION CODE
......@@ -451,8 +456,6 @@
targetPos:tAnchorP,
sourceEndpoint:this.endpoints[sIdx],
targetEndpoint:this.endpoints[tIdx],
sourceAnchor:this.endpoints[sIdx].anchor,
targetAnchor:this.endpoints[tIdx].anchor,
lineWidth:self.paintStyleInUse.lineWidth,
sourceInfo:sourceInfo,
targetInfo:targetInfo,
......@@ -478,8 +481,8 @@
}
}
var lineWidth = (self.paintStyleInUse.lineWidth || 1) / 2,
outlineWidth = self.paintStyleInUse.lineWidth || 0,
var lineWidth = parseFloat(self.paintStyleInUse.lineWidth || 1) / 2,
outlineWidth = parseFloat(self.paintStyleInUse.lineWidth || 0),
extents = {
xmin : Math.min(connector.bounds.minX - (lineWidth + outlineWidth), overlayExtents.minX),
ymin : Math.min(connector.bounds.minY - (lineWidth + outlineWidth), overlayExtents.minY),
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......@@ -41,7 +41,7 @@
/*
* Class: AbstractSegment
* A Connector is made up of 1..N Segments, each of which has a Type, such as 'Straight', 'Arc',
* 'Bezier'. This is new from 1.4.0, and gives us a lot more flexibility when drawing connections: things such
* 'Bezier'. This is new from 1.4.1, and gives us a lot more flexibility when drawing connections: things such
* as rounded corners for flowchart connectors, for example, or a straight line stub for Bezier connections, are
* much easier to do now.
*
......@@ -542,8 +542,8 @@
swapX = params.targetPos[0] < params.sourcePos[0],
swapY = params.targetPos[1] < params.sourcePos[1],
lw = params.lineWidth || 1,
so = params.sourceAnchor.orientation || params.sourceAnchor.getOrientation(params.sourceEndpoint),
to = params.targetAnchor.orientation || params.targetAnchor.getOrientation(params.targetEndpoint),
so = params.sourceEndpoint.anchor.orientation || params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint),
to = params.targetEndpoint.anchor.orientation || params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),
x = swapX ? params.targetPos[0] : params.sourcePos[0],
y = swapY ? params.targetPos[1] : params.sourcePos[1],
w = Math.abs(params.targetPos[0] - params.sourcePos[0]),
......@@ -622,7 +622,7 @@
this.pointAlongPathFrom = function(location, distance, absolute) {
var seg = _findSegmentForLocation(location, absolute);
// TODO what happens if this crosses to the next segment?
return seg.segment.pointAlongPathFrom(seg.proportion, distance, absolute);
return seg.segment.pointAlongPathFrom(seg.proportion, distance, false);
};
this.compute = function(params) {
......@@ -693,11 +693,11 @@
this.type = "Bezier";
this.getCurviness = function() { return majorAnchor; };
this._findControlPoint = function(point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint, sourceAnchor, targetAnchor) {
this._findControlPoint = function(point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint) {
// determine if the two anchors are perpendicular to each other in their orientation. we swap the control
// points around if so (code could be tightened up)
var soo = sourceAnchor.getOrientation(sourceEndpoint),
too = targetAnchor.getOrientation(targetEndpoint),
var soo = sourceEndpoint.anchor.getOrientation(sourceEndpoint),
too = targetEndpoint.anchor.getOrientation(targetEndpoint),
perpendicular = soo[0] != too[0] || soo[1] == too[1],
p = [];
......@@ -732,8 +732,8 @@
_sy = sp[1] < tp[1] ? _h : 0,
_tx = sp[0] < tp[0] ? 0 : _w,
_ty = sp[1] < tp[1] ? 0 : _h,
_CP = self._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint, p.sourceAnchor, p.targetAnchor),
_CP2 = self._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint, p.targetAnchor, p.sourceAnchor);
_CP = self._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint),
_CP2 = self._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint);
_super.addSegment("Bezier", {
x1:_sx, y1:_sy, x2:_tx, y2:_ty,
......@@ -789,10 +789,20 @@
this.defaultInnerRadius = this.radius / 3;
this._compute = function(anchorPoint, orientation, endpointStyle, connectorPaintStyle) {
var r = endpointStyle.radius || self.radius,
x = anchorPoint[0] - r,
y = anchorPoint[1] - r;
return [ x, y, r * 2, r * 2, r ];
self.radius = endpointStyle.radius || self.radius;
var x = anchorPoint[0] - self.radius,
y = anchorPoint[1] - self.radius,
w = self.radius * 2,
h = self.radius * 2;
if (endpointStyle.strokeStyle) {
var lw = endpointStyle.lineWidth || 1;
x -= lw;
y -= lw;
w += (lw * 2);
h += (lw * 2);
}
return [ x, y, w, h, self.radius ];
};
};
......@@ -821,6 +831,7 @@
height = endpointStyle.height || self.height,
x = anchorPoint[0] - (width/2),
y = anchorPoint[1] - (height/2);
return [ x, y, width, height];
};
};
......@@ -1059,7 +1070,7 @@
AbstractOverlay.apply(this, arguments);
this.isAppendedAtTopLevel = false;
params = params || {};
var self = this;
var self = this, _ju = jsPlumbUtil;
this.length = params.length || 20;
this.width = params.width || 20;
......@@ -1076,16 +1087,16 @@
var hxy, mid, txy, tail, cxy;
if (component.pointAlongPathFrom) {
if (jsPlumbUtil.isString(self.loc) || self.loc > 1 || self.loc < 0) {
if (_ju.isString(self.loc) || self.loc > 1 || self.loc < 0) {
var l = parseInt(self.loc);
hxy = component.pointAlongPathFrom(l, direction * self.length / 2, true),
mid = component.pointOnPath(l, true),
txy = jsPlumbUtil.pointOnLine(hxy, mid, self.length);
txy = _ju.pointOnLine(hxy, mid, self.length);
}
else if (self.loc == 1) {
hxy = component.pointOnPath(self.loc);
mid = component.pointAlongPathFrom(self.loc, -1);
txy = jsPlumbUtil.pointOnLine(hxy, mid, self.length);
hxy = component.pointOnPath(self.loc);
mid = component.pointAlongPathFrom(self.loc, -(self.length));
txy = _ju.pointOnLine(hxy, mid, self.length);
if (direction == -1) {
var _ = txy;
......@@ -1095,8 +1106,8 @@
}
else if (self.loc == 0) {
txy = component.pointOnPath(self.loc);
mid = component.pointAlongPathFrom(self.loc, 1);
hxy = jsPlumbUtil.pointOnLine(txy, mid, self.length);
mid = component.pointAlongPathFrom(self.loc, self.length);
hxy = _ju.pointOnLine(txy, mid, self.length);
if (direction == -1) {
var _ = txy;
txy = hxy;
......@@ -1106,11 +1117,11 @@
else {
hxy = component.pointAlongPathFrom(self.loc, direction * self.length / 2),
mid = component.pointOnPath(self.loc),
txy = jsPlumbUtil.pointOnLine(hxy, mid, self.length);
txy = _ju.pointOnLine(hxy, mid, self.length);
}
tail = jsPlumbUtil.perpendicularLineTo(hxy, txy, self.width);
cxy = jsPlumbUtil.pointOnLine(hxy, txy, foldback * self.length);
tail = _ju.perpendicularLineTo(hxy, txy, self.width);
cxy = _ju.pointOnLine(hxy, txy, foldback * self.length);
var d = { hxy:hxy, tail:tail, cxy:cxy },
strokeStyle = paintStyle.strokeStyle || currentConnectionPaintStyle.strokeStyle,
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......@@ -406,6 +406,9 @@
self.svg.appendChild(self.node);
self.attachListeners(self.node, self);
}
else if (self.updateNode != null) {
self.updateNode(self.node);
}
_applyStyles(self.svg, self.node, s, [ self.x, self.y, self.w, self.h ], self);
_pos(self.node, [ self.x, self.y ]);
};
......@@ -425,9 +428,16 @@
return _node("circle", {
"cx" : this.w / 2,
"cy" : this.h / 2,
"r" : this.w / 2
"r" : this.radius
});
};
this.updateNode = function(node) {
_attr(node, {
"cx":this.w / 2,
"cy":this.h / 2,
"r":this.radius
});
};
};
/*
......@@ -441,6 +451,12 @@
"width" : this.w,
"height" : this.h
});
};
this.updateNode = function(node) {
_attr(node, {
"width":this.w,
"height":this.h
});
};
};
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......@@ -170,7 +170,11 @@
*/
VmlComponent = function() {
var self = this, renderer = {};
jsPlumb.jsPlumbUIComponent.apply(this, arguments);
jsPlumb.jsPlumbUIComponent.apply(this, arguments);
this.opacityNodes = {
"stroke":null,
"fill":null
......@@ -282,6 +286,10 @@
var clazz = self._jsPlumb.endpointClass + (params.cssClass ? (" " + params.cssClass) : "");
// TODO vml endpoint adds class to VML at constructor time. but the addClass method adds VML
// to the enclosing DIV. what to do? seems like it would be better to just target the div.
// HOWEVER...vml connection has no containing div. why not? it feels like it should.
//var group = _getGroup(params.parent);
//group.appendChild(self.canvas);
params["_jsPlumb"].appendElement(self.canvas, params.parent);
......@@ -415,7 +423,7 @@
" x e";
};
this.paint = function(params, containerExtents) {
var p = {}, d = params.d, connector = params.connector;
var p = {}, d = params.d, connector = params.component;
if (params.strokeStyle) {
p["stroked"] = "true";
p["strokecolor"] = jsPlumbUtil.convertStyle(params.strokeStyle, true);
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG or VML.
*
......@@ -27,14 +27,18 @@
isArray : function(a) {
return Object.prototype.toString.call(a) === "[object Array]";
},
isNumber : function(n) {
return Object.prototype.toString.call(n) === "[object Number]";
},
isString : function(s) {
return typeof s === "string";
},
isBoolean: function(s) {
return typeof s === "boolean";
},
isNull : function(s) { return s == null; },
isObject : function(o) {
return Object.prototype.toString.call(o) === "[object Object]";
return o == null ? false : Object.prototype.toString.call(o) === "[object Object]";
},
isDate : function(o) {
return Object.prototype.toString.call(o) === "[object Date]";
......@@ -85,6 +89,10 @@
}
return c;
},
copyValues:function(names, from, to) {
for (var i = 0; i < names.length; i++)
to[names[i]] = from[names[i]];
},
//
// chain a list of functions, supplied by [ object, method name, args ], and return on the first
// one that returns the failValue. if none return the failValue, return the successValue.
......@@ -106,7 +114,7 @@
if (matches != null) {
for (var i = 0; i < matches.length; i++) {
var val = values[matches[i].substring(2, matches[i].length - 1)];
if (val) {
if (val != null) {
fromString = fromString.replace(matches[i], val);
}
}
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......@@ -257,7 +257,7 @@
return el.hasClass(clazz);
},
initDraggable : function(el, options, isPlumbedComponent) {
initDraggable : function(el, options, isPlumbedComponent, _jsPlumb) {
var id = jsPlumb.getId(el);
var drag = _draggablesById[id];
if (!drag) {
......@@ -387,6 +387,10 @@
setAttribute : function(el, attName, attValue) {
el.set(attName, attValue);
},
setDragFilter : function(el, filter) {
jsPlumb.log("NOT IMPLEMENTED: setDragFilter")
},
setDraggable : function(el, draggable) {
var draggables = _draggablesById[el.get("id")];
......
/*
* jsPlumb
*
* Title:jsPlumb 1.4.0
* Title:jsPlumb 1.4.1
*
* Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
* elements, or VML.
......@@ -285,9 +285,9 @@
return el.hasClass(clazz);
},
initDraggable : function(el, options, isPlumbedComponent) {
initDraggable : function(el, options, isPlumbedComponent, _jsPlumb) {
var _opts = _getDDOptions(options),
id = jsPlumb.getId(el);
id = _jsPlumb.getId(el);
_opts.node = "#" + id;
var dd = new Y.DD.Drag(_opts),
containment = options.constrain2node || options.containment;
......@@ -300,7 +300,7 @@
}
if (isPlumbedComponent) {
var scope = options['scope'] || jsPlumb.Defaults.Scope;
var scope = options['scope'] || _jsPlumb.Defaults.Scope;
dd.scope = scope;
_add(_draggablesByScope, scope, dd);
}
......@@ -352,6 +352,10 @@
setAttribute : function(el, attributeName, attributeValue) {
el.setAttribute(attributeName, attributeValue);
},
setDragFilter : function(el, filter) {
jsPlumb.log("NOT IMPLEMENTED: setDragFilter")
},
/**
* sets the draggable state for the given element
......
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