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

Function removeClass

static/vuejs/vue.runtime.js:5715–5736  ·  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

5713 * SVG elements in IE
5714 */
5715function removeClass (el, cls) {
5716 /* istanbul ignore if */
5717 if (!cls || !(cls = cls.trim())) {
5718 return
5719 }
5720
5721 /* istanbul ignore else */
5722 if (el.classList) {
5723 if (cls.indexOf(' ') > -1) {
5724 cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
5725 } else {
5726 el.classList.remove(cls);
5727 }
5728 } else {
5729 var cur = " " + (el.getAttribute('class') || '') + " ";
5730 var tar = ' ' + cls + ' ';
5731 while (cur.indexOf(tar) >= 0) {
5732 cur = cur.replace(tar, ' ');
5733 }
5734 el.setAttribute('class', cur.trim());
5735 }
5736}
5737
5738/* */
5739

Callers 2

removeTransitionClassFunction · 0.70
vue.runtime.jsFile · 0.70

Calls 2

getAttributeMethod · 0.80
setAttributeMethod · 0.45

Tested by

no test coverage detected