mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
fix: remove calls to removeClass and hasClass (#6413)
* fix: stop using dom.addClass in most cases * chore: format * fix: remove use of dom.addClass in toolbox * chore: lint and format * fix: add checks around non-constant class names * fix: switch back to quoted access * chore: format * fix: remove calls to removeClass * chore: format * chore: remove unused deps * fix: remove uses of hasClass * chore: format and lint * chore: format
This commit is contained in:
@@ -162,10 +162,13 @@ export class PathObject implements IPathObject {
|
||||
* removed.
|
||||
*/
|
||||
protected setClass_(className: string, add: boolean) {
|
||||
if (!className) {
|
||||
return;
|
||||
}
|
||||
if (add) {
|
||||
dom.addClass(this.svgRoot as Element, className);
|
||||
this.svgRoot.classList.add(className);
|
||||
} else {
|
||||
dom.removeClass(this.svgRoot as Element, className);
|
||||
this.svgRoot.classList.remove(className);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user