File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -1735,11 +1735,7 @@ export class BlockSvg
17351735 * @internal
17361736 */
17371737 fadeForReplacement ( add : boolean ) {
1738- if ( add ) {
1739- this . addClass ( 'blocklyReplaceable' ) ;
1740- } else {
1741- this . removeClass ( 'blocklyReplaceable' ) ;
1742- }
1738+ this . pathObject . updateReplacing ?.( add ) ;
17431739 }
17441740
17451741 /**
Original file line number Diff line number Diff line change @@ -106,4 +106,13 @@ export interface IPathObject {
106106 * @param blockStyle The block style to use.
107107 */
108108 setStyle ?( blockStyle : BlockStyle ) : void ;
109+
110+ /**
111+ * Add or remove styling indicating that a block will be bumped out and
112+ * replaced by another block that is mid-move.
113+ *
114+ * @param replacing True if the block is at risk of being replaced, false
115+ * otherwise.
116+ */
117+ updateReplacing ?( replacing : boolean ) : void ;
109118}
Original file line number Diff line number Diff line change @@ -191,6 +191,17 @@ export class PathObject implements IPathObject {
191191 this . setClass_ ( 'blocklyDraggable' , enable ) ;
192192 }
193193
194+ /**
195+ * Add or remove styling indicating that a block will be bumped out and
196+ * replaced by another block that is mid-move.
197+ *
198+ * @param replacing True if the block is at risk of being replaced, false
199+ * otherwise.
200+ */
201+ updateReplacing ( replacing : boolean ) {
202+ this . setClass_ ( 'blocklyReplaceable' , replacing ) ;
203+ }
204+
194205 /** Adds the given path as a connection highlight for the given connection. */
195206 addConnectionHighlight (
196207 connection : RenderedConnection ,
You can’t perform that action at this time.
0 commit comments