MCPcopy Create free account
hub / github.com/flyfloor/react-component / _removeClass

Function _removeClass

lib/util/dom.js:33–48  ·  view source on GitHub ↗
(el, className)

Source from the content-addressed store, hash-verified

31}
32
33function _removeClass(el, className) {
34 var clist = getClassList(el);
35 var length = clist.length;
36 var str = '',
37 changed = false;
38 for (var i = 0; i < length; i++) {
39 if (!clist[i]) continue;
40 if (clist[i] === className) {
41 changed = true;
42 } else {
43 if (str) str += ' ';
44 str += clist[i];
45 }
46 }
47 if (changed) el.className = str;
48}
49
50function hasClass(el, className) {
51 if (el && className && el instanceof Node) {

Callers 1

removeClassFunction · 0.70

Calls 1

getClassListFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…