From 9c88970d463b851820455d85de7b74e73d2209c4 Mon Sep 17 00:00:00 2001 From: Shreshtha Sharma <145495563+Shreshthaaa@users.noreply.github.com> Date: Wed, 31 Jul 2024 05:20:38 +0530 Subject: [PATCH] feat: added blocklyNotDetetable class to block_svg (#8406) * feat: added blocklynotdetetable class to block_svg * feat: added blocklynotdetetable class to block_svg --- core/block_svg.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/block_svg.ts b/core/block_svg.ts index a289db556..7bdbd5b79 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -1079,6 +1079,20 @@ export class BlockSvg } } + /** + * Add blocklyNotDeletable class when block is not deletable + * Or remove class when block is deletable + */ + override setDeletable(deletable: boolean) { + super.setDeletable(deletable); + + if (deletable) { + dom.removeClass(this.svgGroup_, 'blocklyNotDeletable'); + } else { + dom.addClass(this.svgGroup_, 'blocklyNotDeletable'); + } + } + /** * Set whether the block is highlighted or not. Block highlighting is * often used to visually mark blocks currently being executed.