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

Function removeClass

static/vuejs/vue.esm.js:6167–6188  ·  view source on GitHub ↗

* Remove class with compatibility for SVG since classList is not supported on * SVG elements in IE

(el, cls)

Source from the content-addressed store, hash-verified

6165 * SVG elements in IE
6166 */
6167function removeClass (el, cls) {
6168 /* istanbul ignore if */
6169 if (!cls || !(cls = cls.trim())) {
6170 return
6171 }
6172
6173 /* istanbul ignore else */
6174 if (el.classList) {
6175 if (cls.indexOf(' ') > -1) {
6176 cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
6177 } else {
6178 el.classList.remove(cls);
6179 }
6180 } else {
6181 var cur = " " + (el.getAttribute('class') || '') + " ";
6182 var tar = ' ' + cls + ' ';
6183 while (cur.indexOf(tar) >= 0) {
6184 cur = cur.replace(tar, ' ');
6185 }
6186 el.setAttribute('class', cur.trim());
6187 }
6188}
6189
6190/* */
6191

Callers 2

removeTransitionClassFunction · 0.70
vue.esm.jsFile · 0.70

Calls 2

getAttributeMethod · 0.80
setAttributeMethod · 0.45

Tested by

no test coverage detected