diff --git a/src/commands/view/SelectComponent.ts b/src/commands/view/SelectComponent.ts index bac67d17b..acd8589d5 100644 --- a/src/commands/view/SelectComponent.ts +++ b/src/commands/view/SelectComponent.ts @@ -495,14 +495,16 @@ export default { * @param {Object} mod */ updateToolbar(mod: Component) { + const { canvas } = this; const { em } = this.config; - const model = mod == em ? em.getSelected() : mod; - const toolbarEl = this.canvas.getToolbarEl()!; + const model = mod === em ? em.getSelected() : mod; + const toolbarEl = canvas.getToolbarEl()!; const toolbarStyle = toolbarEl.style; const toolbar = model.get('toolbar'); const showToolbar = em.config.showToolbar; + const noCustomSpotSelect = !canvas.hasCustomSpot(CanvasSpotBuiltInTypes.Select); - if (model && showToolbar && toolbar && toolbar.length) { + if (model && showToolbar && toolbar && toolbar.length && noCustomSpotSelect) { toolbarStyle.display = ''; if (!this.toolbar) { toolbarEl.innerHTML = ''; diff --git a/src/dom_components/view/ComponentView.ts b/src/dom_components/view/ComponentView.ts index 219730ef9..6c9cc5b6e 100644 --- a/src/dom_components/view/ComponentView.ts +++ b/src/dom_components/view/ComponentView.ts @@ -1,4 +1,5 @@ import { each, isEmpty, keys, result } from 'underscore'; +import { CanvasSpotBuiltInTypes } from '../../canvas/model/CanvasSpot'; import FrameView from '../../canvas/view/FrameView'; import { ExtractMethods, ObjectAny, View } from '../../common'; import { GetSetRuleOptions } from '../../css_composer'; @@ -231,7 +232,8 @@ Component> { * */ updateStatus(opts: { noExtHl?: boolean; avoidHover?: boolean } = {}) { const { em, el, ppfx, model } = this; - const extHl = em?.Canvas.getConfig().extHl; + const canvas = em.Canvas; + const extHl = canvas.getConfig().extHl; const status = model.get('status'); const selectedCls = `${ppfx}selected`; const selectedParentCls = `${selectedCls}-parent`; @@ -243,10 +245,11 @@ Component> { this.$el.removeClass(toRemove.join(' ')); const actualCls = el.getAttribute('class') || ''; const cls = [actualCls]; + const noCustomSpotSelect = !canvas.hasCustomSpot(CanvasSpotBuiltInTypes.Select); switch (status) { case 'selected': - cls.push(selCls); + noCustomSpotSelect && cls.push(selCls); break; case 'selected-parent': cls.push(selectedParentCls); @@ -255,7 +258,8 @@ Component> { cls.push(freezedCls); break; case 'freezed-selected': - cls.push(freezedCls, selCls); + cls.push(freezedCls); + noCustomSpotSelect && cls.push(selCls); break; case 'hovered': !opts.avoidHover && cls.push(hoveredCls);