From fb90c4a99581168d910f011982a719f4d4175193 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 19 Jan 2021 00:17:53 +0100 Subject: [PATCH] Allow to remove single symbol --- src/dom_components/model/Component.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 6134ee15a..40cc04ae7 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -598,7 +598,11 @@ const Component = Backbone.Model.extend(Styleable).extend( __isSymbolTop() { const parent = this.parent(); - return this.__isSymbol() && parent && !parent.__isSymbol(); + return ( + parent && + ((this.__isSymbol() && !parent.__isSymbol()) || + (this.__getSymbol() && !parent.__getSymbol())) + ); }, __getSymbol() { @@ -734,14 +738,14 @@ const Component = Backbone.Model.extend(Styleable).extend( m.toHTML(), o, 'isSymb', - this.__isSymbol(), + m.__isSymbol(), 'symbToUp', m.__getSymbToUp(toUpOpts), { toUpOpts } ); - m.__getSymbToUp(toUpOpts).forEach(symb => - symb.remove({ fromInstance: m, ...o }) - ); + const symbToUp = m.__getSymbToUp(toUpOpts); + !m.__isSymbolTop() && + symbToUp.forEach(symb => symb.remove({ fromInstance: m, ...o })); } },