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

Function removeClass

static/nprogress/nprogress.js:443–454  ·  view source on GitHub ↗

* (Internal) Removes a class from an element.

(element, name)

Source from the content-addressed store, hash-verified

441 */
442
443 function removeClass(element, name) {
444 var oldList = classList(element),
445 newList;
446
447 if (!hasClass(element, name)) return;
448
449 // Replace the class name.
450 newList = oldList.replace(' ' + name + ' ', ' ');
451
452 // Trim the opening and closing spaces.
453 element.className = newList.substring(1, newList.length - 1);
454 }
455
456 /**
457 * (Internal) Gets a space separated list of the class names on the element.

Callers 1

nprogress.jsFile · 0.70

Calls 2

classListFunction · 0.85
hasClassFunction · 0.85

Tested by

no test coverage detected