From 73342a0506d601dc59dfb7e65edaa4124097cdeb Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Tue, 30 Jul 2019 17:12:17 +0200 Subject: [PATCH] Merged conflicts. --- .eslintrc | 3 ++- lib/scatter.js | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.eslintrc b/.eslintrc index 1aa0400..290b33b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,7 +3,8 @@ "ecmaVersion": 10, "sourceType": "module", "ecmaFeatures": { - "impliedStrict": true + "impliedStrict": true, + "modules": true } }, "env": { diff --git a/lib/scatter.js b/lib/scatter.js index 1123cc3..14c5c2d 100644 --- a/lib/scatter.js +++ b/lib/scatter.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-vars */ /* eslint-disable no-console */ -/* globals TweenLite debugCanvas */ +/* globals debugCanvas */ import Interface from './interface.js' import { Points, Polygon, Angle, Elements, LowPassFilter } from './utils.js' import Events from './events.js' @@ -351,15 +351,20 @@ export class AbstractScatter extends Throwable { } close() { + this._callCloseCallbacks() + this._removeSelfFromScatterContainer() + } + + _callCloseCallbacks() { if (this.onClose) { this.onClose.forEach(callback => callback(this)) + } + } - /** - Removes self from container when it's closed. - */ - if (this.container) { - this.container.remove(this) - } + _removeSelfFromScatterContainer() { + // Removes self from container when it's closed. + if (this.container) { + this.container.remove(this) } }