From 64fd9ad89a5d48ccc18708d322340ed1523fa753 Mon Sep 17 00:00:00 2001 From: Shreshtha Sharma <145495563+Shreshthaaa@users.noreply.github.com> Date: Wed, 14 Aug 2024 21:36:27 +0530 Subject: [PATCH] =?UTF-8?q?feat:=20added=20`blocklyHighlighted`=20CSS=20cl?= =?UTF-8?q?ass=20to=20highlighted=20block's=20root=E2=80=A6=20(#8407)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg * fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg * fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg * fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg * fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg --- core/renderers/common/path_object.ts | 3 +++ core/renderers/geras/path_object.ts | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/renderers/common/path_object.ts b/core/renderers/common/path_object.ts index c5ac5db20f0..12e23b6c4aa 100644 --- a/core/renderers/common/path_object.ts +++ b/core/renderers/common/path_object.ts @@ -170,14 +170,17 @@ export class PathObject implements IPathObject { * * @param enable True if highlighted. */ + updateHighlighted(enable: boolean) { if (enable) { this.svgPath.setAttribute( 'filter', 'url(#' + this.constants.embossFilterId + ')', ); + this.setClass_('blocklyHighlighted', true); } else { this.svgPath.setAttribute('filter', 'none'); + this.setClass_('blocklyHighlighted', false); } } diff --git a/core/renderers/geras/path_object.ts b/core/renderers/geras/path_object.ts index 6b058e5a752..321302a265a 100644 --- a/core/renderers/geras/path_object.ts +++ b/core/renderers/geras/path_object.ts @@ -103,14 +103,10 @@ export class PathObject extends BasePathObject { } override updateHighlighted(highlighted: boolean) { + super.updateHighlighted(highlighted); if (highlighted) { - this.svgPath.setAttribute( - 'filter', - 'url(#' + this.constants.embossFilterId + ')', - ); this.svgPathLight.style.display = 'none'; } else { - this.svgPath.setAttribute('filter', 'none'); this.svgPathLight.style.display = 'inline'; } }