MCPcopy Index your code
hub / github.com/SortableJS/Sortable / toggleClass

Function toggleClass

Sortable.js:178–187  ·  view source on GitHub ↗
(el, name, state)

Source from the content-addressed store, hash-verified

176 }
177 var R_SPACE = /\s+/g;
178 function toggleClass(el, name, state) {
179 if (el && name) {
180 if (el.classList) {
181 el.classList[state ? 'add' : 'remove'](name);
182 } else {
183 var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
184 el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
185 }
186 }
187 }
188 function css(el, prop, val) {
189 var style = el && el.style;
190 if (style) {

Callers 11

setupCloneFunction · 0.90
dropFunction · 0.90
_deselectMultiDragFunction · 0.90
selectFunction · 0.90
deselectFunction · 0.90
dragOverValidFunction · 0.90
dropFunction · 0.90
Sortable.jsFile · 0.70
completedFunction · 0.70
SwapPluginFunction · 0.70
MultiDragPluginFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…