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

Function removeClass

static/vuejs/vue.js:6163–6184  ·  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

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

Callers 2

removeTransitionClassFunction · 0.70
vue.jsFile · 0.70

Calls 2

getAttributeMethod · 0.80
setAttributeMethod · 0.45

Tested by

no test coverage detected