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

Function removeClass

static/vuejs/vue.runtime.common.js:5721–5742  ·  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

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

Callers 2

removeTransitionClassFunction · 0.70

Calls 2

getAttributeMethod · 0.80
setAttributeMethod · 0.45

Tested by

no test coverage detected