From d7f66461baed781996d15fd96942cf1e226f3696 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Wed, 29 May 2019 20:56:13 +0200 Subject: [PATCH] fix(ie): polyfill Element.classList --- src/client/polyfills/dom.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/polyfills/dom.js b/src/client/polyfills/dom.js index a1c71635f6f..db4cea452ea 100644 --- a/src/client/polyfills/dom.js +++ b/src/client/polyfills/dom.js @@ -86,3 +86,9 @@ Element.getRootNode() Element.remove() */ (function(b){b.forEach(function(a){a.hasOwnProperty("remove")||Object.defineProperty(a,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})})})([Element.prototype,CharacterData.prototype,DocumentType.prototype]); + +/*! +Element.classList +*/ +!function(e){e.classList||Object.defineProperty(e,"classList",{get:function(){var e=this,t=(e.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){t.length>0?e.setAttribute("class",t.join(" ")):e.removeAttribute("class")}return""===t[0]&&t.splice(0,1),t.toggle=function(e,i){void 0!==i?i?t.add(e):t.remove(e):-1!==t.indexOf(e)?t.splice(t.indexOf(e),1):t.push(e),n()},t.add=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i