From df743ab902e1427b12842ff9542ce9189c37f2b6 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Tue, 28 Mar 2017 17:11:20 +0800 Subject: Fix listener “this” context --- public/js/lib/editor/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public/js') diff --git a/public/js/lib/editor/index.js b/public/js/lib/editor/index.js index a68092ff..dead0c40 100644 --- a/public/js/lib/editor/index.js +++ b/public/js/lib/editor/index.js @@ -127,7 +127,7 @@ export default class Editor { } this.editor.on(event, (...args) => { - this.eventListeners[event].forEach(cb => cb(...args)) + this.eventListeners[event].forEach(cb => cb.bind(this)(...args)) }) } -- cgit v1.2.3