From 524f47cab966f879950069afed9ebbff9e2672c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KB=20J=C3=B8rgensen?= Date: Fri, 19 Jan 2018 16:08:35 +0100 Subject: [PATCH] Let the 'this' keyword propagate in to the for each loop. --- editor/extensions/ext-connector.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/editor/extensions/ext-connector.js b/editor/extensions/ext-connector.js index 2386df53..6d9d7ab7 100644 --- a/editor/extensions/ext-connector.js +++ b/editor/extensions/ext-connector.js @@ -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];