Skip to content

Commit

Permalink
Merge pull request #3 from MathuraMG/remove-objects
Browse files Browse the repository at this point in the history
clear objects array
  • Loading branch information
MathuraMG authored Feb 16, 2017
2 parents cf08d7f + 220e896 commit a1c1267
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions entities/_baseEntity.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ function BaseEntity(Interceptor,object,arguments, canvasX, canvasY) {
var xCoord, yCoord;
arguments = [].slice.call(arguments);
var i = 0;
var that = this;
that.coordinates = '';

arguments.forEach(function(argument){
a = argument;

if (object.params[i].description.indexOf('x-coordinate') > -1) {
xCoord = a;
this.coordinates += a + 'x,';
that.coordinates += a + 'x,';
} else if (object.params[i].description.indexOf('y-coordinate') > -1) {
yCoord = a;
this.coordinates += a + 'y';
that.coordinates += a + 'y';
}
i++;
});
Expand Down
2 changes: 1 addition & 1 deletion entities/entity.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gridInterceptor/interceptorFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gridInterceptor.prototype = Object.create(baseInterceptor.prototype);

gridInterceptor.prototype.clearVariables = function(object) {
object.objectTypeCount = {};
object.objectArray = [];
object.objectCount = 0;
this.isCleared = true;
return object;
Expand Down
5 changes: 3 additions & 2 deletions textInterceptor/interceptorFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ textInterceptor.prototype = Object.create(baseInterceptor.prototype);

textInterceptor.prototype.clearVariables = function(object) {
object.objectTypeCount = {};
object.objectArray = [];
object.objectCount = 0;
this.isCleared = true;
return object;
Expand Down Expand Up @@ -166,7 +167,7 @@ textInterceptor.prototype.getSummary = function(object1, object2, element) {
var objectList = document.createElement('ul');

if (this.totalCount < 100) {

object1.objectArray.forEach(function(objArrayItem,i){
var objectListItem = document.createElement('li');
objectList.appendChild(objectListItem);
Expand All @@ -177,7 +178,7 @@ textInterceptor.prototype.getSummary = function(object1, object2, element) {
objectListItem.innerHTML += '; area = ' + objArrayItem['area'] +
'; location = ' + objArrayItem['location'];
});

object2.objectArray.forEach(function(objArrayItem,i){
var objectListItem = document.createElement('li');
objectList.appendChild(objectListItem);
Expand Down

0 comments on commit a1c1267

Please sign in to comment.