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:
Rachel Fenichel
2022-09-13 08:33:49 -07:00
committed by GitHub
parent 26561947fb
commit 5f11f3449f
26 changed files with 164 additions and 145 deletions

View File

@@ -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);
}
}