Let the 'this' keyword propagate in to the for each loop.

master
KB Jørgensen 2018-01-19 16:08:35 +01:00
parent 02c8721c2d
commit 524f47cab9
1 changed files with 4 additions and 5 deletions

View File

@ -160,7 +160,6 @@ svgEditor.addExtension("Connector", function(S) {
// Loop through connectors to see if one is connected to the element
connectors.each(function() {
var connector = this;
var add_this;
function add () {
if ($.inArray(this, elems) !== -1) {
@ -175,13 +174,13 @@ svgEditor.addExtension("Connector", function(S) {
var part = elData(this, 'c_'+pos);
if(part == null) {
part = document.getElementById(
connector.attributes['se:connector'].value.split(' ')[i]
this.attributes['se:connector'].value.split(' ')[i]
);
elData(connector, 'c_'+pos, part.id);
elData(connector, pos+'_bb', svgCanvas.getStrokedBBox([part]));
elData(this, 'c_'+pos, part.id);
elData(this, pos+'_bb', svgCanvas.getStrokedBBox([part]));
}
parts.push(part);
});
}.bind(this));
for (i = 0; i < 2; i++) {
var c_elem = parts[i];