From b8bfe153ad8d175975a73c1cb0bbdd1f1b0b0212 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 27 Jun 2021 21:05:40 +0200 Subject: [PATCH] Update FrameView tools container --- src/canvas/view/FrameView.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/canvas/view/FrameView.js b/src/canvas/view/FrameView.js index d390031aa..4b8977ab7 100644 --- a/src/canvas/view/FrameView.js +++ b/src/canvas/view/FrameView.js @@ -30,6 +30,7 @@ export default Backbone.View.extend({ '_emitUpdate' ); const { model, el } = this; + this.tools = {}; this.config = { ...(o.config || {}), frameView: this @@ -163,18 +164,20 @@ export default Backbone.View.extend({ }, _getTool(name) { + const { tools } = this; const toolsEl = this.getToolsEl(); - if (!this[name]) { - this[name] = toolsEl.querySelector(name); + if (!tools[name]) { + tools[name] = toolsEl.querySelector(name); } - return this[name]; + return tools[name]; }, remove() { const wrp = this.wrapper; this._toggleEffects(); + this.tools = {}; wrp && wrp.remove(); Backbone.View.prototype.remove.apply(this, arguments); },