MCPcopy Index your code
hub / github.com/TruthHun/BookStack / removeClass

Function removeClass

static/vuejs/vue.runtime.esm.js:5719–5740  ·  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

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

Callers 2

removeTransitionClassFunction · 0.70
vue.runtime.esm.jsFile · 0.70

Calls 2

getAttributeMethod · 0.80
setAttributeMethod · 0.45

Tested by

no test coverage detected