MCPcopy
hub / github.com/monkeytypegame/monkeytype / addClass

Method addClass

frontend/src/ts/utils/dom.ts:281–293  ·  view source on GitHub ↗

* Add a class to the element

(className: string | string[])

Source from the content-addressed store, hash-verified

279 * Add a class to the element
280 */
281 addClass(className: string | string[]): this {
282 if (Array.isArray(className)) {
283 this.native.classList.add(...className);
284 } else {
285 if (className.includes(" ")) {
286 return this.addClass(
287 className.split(" ").filter((cn) => cn.length > 0),
288 );
289 }
290 this.native.classList.add(className);
291 }
292 return this;
293 }
294
295 /**
296 * Remove a class from the element

Callers 15

hideMethod · 0.95
changeFunction · 0.45
applyFunction · 0.45
applyCustomBackgroundFunction · 0.45
ad-controller.tsFile · 0.45
submitFunction · 0.45
updateActiveButtonsFunction · 0.45
updateUIFunction · 0.45
constructorMethod · 0.45
doSortMethod · 0.45
addClassMethod · 0.45

Calls 1

addMethod · 0.45

Tested by

no test coverage detected