1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 17:39:57 +02:00

Move condition about onBeforeChange (#878)

This commit is contained in:
Samy Pessé
2017-06-10 19:33:23 +02:00
committed by Ian Storm Taylor
parent b4883ea552
commit 54d204b87e

View File

@@ -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)