Browse Source

Hide badge if `component.badgable` is `false`. Fixes #5340

pull/5358/head
Artur Arseniev 2 years ago
parent
commit
0315af8fc9
  1. 8
      src/commands/view/SelectComponent.ts

8
src/commands/view/SelectComponent.ts

@ -332,8 +332,13 @@ export default {
updateBadge(el: HTMLElement, pos: any, opts: any = {}) {
const { canvas } = this;
const model = getComponentModel(el);
if (!model || !model.get('badgable')) return;
const badge = this.getBadge(opts);
const bStyle = badge.style;
if (!model || !model.get('badgable')) {
bStyle.display = 'none';
return;
}
if (!opts.posOnly) {
const config = this.canvas.getConfig();
@ -347,7 +352,6 @@ export default {
}
const un = 'px';
const bStyle = badge.style;
bStyle.display = 'block';
const targetToElem = canvas.getTargetToElementFixed(el, badge, {

Loading…
Cancel
Save