From 54d204b87e7037815155029b1e310efc1d0cfc47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Sat, 10 Jun 2017 19:33:23 +0200 Subject: [PATCH] Move condition about onBeforeChange (#878) --- src/models/stack.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/models/stack.js b/src/models/stack.js index 75ce3397c..1f2f88405 100644 --- a/src/models/stack.js +++ b/src/models/stack.js @@ -148,10 +148,6 @@ for (const method of EVENT_HANDLER_METHODS) { Stack.prototype[method] = function (state, editor, ...args) { debug(method) - if (method == 'onChange') { - state = this.onBeforeChange(state, editor) - } - for (const plugin of this.plugins) { if (!plugin[method]) continue const next = plugin[method](...args, state, editor) @@ -177,6 +173,10 @@ for (const method of STATE_ACCUMULATOR_METHODS) { Stack.prototype[method] = function (state, editor, ...args) { debug(method) + if (method == 'onChange') { + state = this.onBeforeChange(state, editor) + } + for (const plugin of this.plugins) { if (!plugin[method]) continue const next = plugin[method](...args, state, editor)