Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions core/block_svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,26 @@ export class BlockSvg
}
}

/**
* Add a class to the SVG group of this block.
Comment thread
BeksOmega marked this conversation as resolved.
Outdated
*
* @param className
* @internal
Comment thread
BeksOmega marked this conversation as resolved.
Outdated
*/
addClass(className: string) {
dom.addClass(this.svgGroup_, className);
}

/**
* Remove a class from the SVG group of this block.
*
* @param className
* @internal
Comment thread
BeksOmega marked this conversation as resolved.
Outdated
*/
removeClass(className: string) {
dom.removeClass(this.svgGroup_, className);
}

/**
* Recursively adds or removes the dragging class to this node and its
* children.
Expand All @@ -683,10 +703,10 @@ export class BlockSvg
if (adding) {
this.translation = '';
common.draggingConnections.push(...this.getConnections_(true));
dom.addClass(this.svgGroup_, 'blocklyDragging');
this.addClass('blocklyDragging');
} else {
common.draggingConnections.length = 0;
dom.removeClass(this.svgGroup_, 'blocklyDragging');
this.removeClass('blocklyDragging');
}
// Recurse through all blocks attached under this one.
for (let i = 0; i < this.childBlocks_.length; i++) {
Expand Down