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

Function removeClass

static/vuejs/vue.common.js:6169–6190  ·  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

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

Callers 2

removeTransitionClassFunction · 0.70
vue.common.jsFile · 0.70

Calls 2

getAttributeMethod · 0.80
setAttributeMethod · 0.45

Tested by

no test coverage detected