Browse Source

Use target spot check in ComponentView

pull/5358/head
Artur Arseniev 2 years ago
parent
commit
e90f3aaca6
  1. 3
      src/dom_components/view/ComponentView.ts
  2. 2
      src/utils/Sorter.ts

3
src/dom_components/view/ComponentView.ts

@ -242,13 +242,14 @@ Component> {
const actualCls = el.getAttribute('class') || '';
const cls = [actualCls];
const noCustomSpotSelect = !canvas?.hasCustomSpot(CanvasSpotBuiltInTypes.Select);
const noCustomSpotTarget = !canvas?.hasCustomSpot(CanvasSpotBuiltInTypes.Target);
switch (status) {
case 'selected':
noCustomSpotSelect && cls.push(selCls);
break;
case 'selected-parent':
cls.push(selectedParentCls);
noCustomSpotTarget && cls.push(selectedParentCls);
break;
case 'freezed':
cls.push(freezedCls);

2
src/utils/Sorter.ts

@ -501,7 +501,7 @@ export default class Sorter extends View {
const { Select, Hover, Spacing } = CanvasSpotBuiltInTypes;
[Select, Hover, Spacing].forEach(type => cv.removeSpots({ type }));
cv.addSpot({ ...spotTarget, component: model as any });
!cv.hasCustomSpot(targetSpotType) && model.set('status', 'selected-parent');
model.set('status', 'selected-parent');
this.targetModel = model;
}
}

Loading…
Cancel
Save