MCPcopy Create free account
hub / github.com/TruthHun/BookStack / addClass

Function addClass

static/nprogress/nprogress.js:429–437  ·  view source on GitHub ↗

* (Internal) Adds a class to an element.

(element, name)

Source from the content-addressed store, hash-verified

427 */
428
429 function addClass(element, name) {
430 var oldList = classList(element),
431 newList = oldList + name;
432
433 if (hasClass(oldList, name)) return;
434
435 // Trim the opening space.
436 element.className = newList.substring(1);
437 }
438
439 /**
440 * (Internal) Removes a class from an element.

Callers 1

nprogress.jsFile · 0.70

Calls 2

classListFunction · 0.85
hasClassFunction · 0.85

Tested by

no test coverage detected