From a5afa7d816f3cc9b6d889f4d615d0bccd26baee6 Mon Sep 17 00:00:00 2001 From: ojack Date: Fri, 11 Feb 2022 15:09:41 +0100 Subject: [PATCH] forward editor events to store --- frontend/web-editor/public/bundle.js | 4 ++++ frontend/web-editor/src/views/EditorComponent.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/frontend/web-editor/public/bundle.js b/frontend/web-editor/public/bundle.js index 93c83d4..a51a414 100644 --- a/frontend/web-editor/public/bundle.js +++ b/frontend/web-editor/public/bundle.js @@ -15307,10 +15307,14 @@ module.exports = class Editor extends Component { constructor (id, state, emit) { super(id) this.local = state.components[id] = {} + this.emit = emit } load (element) { this.editor = new HydraEditor(this.textEl) + this.editor.on("*", (e, t) => { + this.emit(e) + }) } update (center) { diff --git a/frontend/web-editor/src/views/EditorComponent.js b/frontend/web-editor/src/views/EditorComponent.js index f6e4461..8805683 100644 --- a/frontend/web-editor/src/views/EditorComponent.js +++ b/frontend/web-editor/src/views/EditorComponent.js @@ -6,10 +6,14 @@ module.exports = class Editor extends Component { constructor (id, state, emit) { super(id) this.local = state.components[id] = {} + this.emit = emit } load (element) { this.editor = new HydraEditor(this.textEl) + this.editor.on("*", (e, t) => { + this.emit(e) + }) } update (center) {