From eb1ee1ca5550dccd4c3a02c93815cd32409518e5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Oct 2018 15:15:49 +0200 Subject: [PATCH] bind instead of second member var --- src/resizer/resizer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resizer/resizer.js b/src/resizer/resizer.js index f207f4a215..c5112e5139 100644 --- a/src/resizer/resizer.js +++ b/src/resizer/resizer.js @@ -40,7 +40,7 @@ export class Resizer { vertical: "resizer-vertical", resizing: "resizer-resizing", }; - this.mouseDownHandler = (event) => this._onMouseDown(event); + this._onMouseDown = this._onMouseDown.bind(this); } setClassNames(classNames) { @@ -48,11 +48,11 @@ export class Resizer { } attach() { - this.container.addEventListener("mousedown", this.mouseDownHandler, false); + this.container.addEventListener("mousedown", this._onMouseDown, false); } detach() { - this.container.removeEventListener("mousedown", this.mouseDownHandler, false); + this.container.removeEventListener("mousedown", this._onMouseDown, false); } /**