MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / rmClass

Function rmClass

lib/web/CodeMirror/src/util/dom.js:5–12  ·  view source on GitHub ↗
(node, cls)

Source from the content-addressed store, hash-verified

3export function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
4
5export let rmClass = function(node, cls) {
6 let current = node.className
7 let match = classTest(cls).exec(current)
8 if (match) {
9 let after = current.slice(match.index + match[0].length)
10 node.className = current.slice(0, match.index) + (after ? match[1] + after : "")
11 }
12}
13
14export function removeChildren(e) {
15 for (let count = e.childNodes.length; count > 0; --count)

Callers 5

initScrollbarsFunction · 0.90
onBlurFunction · 0.90
wrappingChangedFunction · 0.90
upFunction · 0.90
methods.jsFile · 0.90

Calls 2

classTestFunction · 0.70
execMethod · 0.65

Tested by

no test coverage detected