From 47ae294f875285d3ae3dcfb653c9393189493b83 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 27 Aug 2020 19:50:50 +0200 Subject: [PATCH] Make textnodes correctly removable. Closes #2918 --- .../view/ComponentTextNodeView.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/dom_components/view/ComponentTextNodeView.js b/src/dom_components/view/ComponentTextNodeView.js index 012fb8311..900ea7d6b 100644 --- a/src/dom_components/view/ComponentTextNodeView.js +++ b/src/dom_components/view/ComponentTextNodeView.js @@ -1,14 +1,23 @@ -import Backbone from 'backbone'; +import ComponentView from './ComponentView'; -export default Backbone.View.extend({ +export default ComponentView.extend({ initialize() { - const { $el, model } = this; - $el.data('model', model); - model.view = this; + ComponentView.prototype.initialize.apply(this, arguments); }, + + // Clear methods used on Nodes with attributes + _setAttributes() {}, + renderAttributes() {}, + setAttribute() {}, + updateAttributes() {}, + initClasses() {}, + initComponents() {}, + delegateEvents() {}, + _createElement() { return document.createTextNode(''); }, + render() { const { model, el } = this; if (model.opt.temporary) return this;