feat: added blocklyNotDetetable class to block_svg (#8406)

* feat: added blocklynotdetetable class to block_svg

* feat: added blocklynotdetetable class to block_svg
This commit is contained in:
Shreshtha Sharma
2024-07-31 05:20:38 +05:30
committed by GitHub
parent dc1f276759
commit 9c88970d46

View File

@@ -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.