mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
1.8 KiB
JSON
1 line
1.8 KiB
JSON
|
{"ast":null,"code":"import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}","map":{"version":3,"sources":["/app/node_modules/dom-helpers/esm/addClass.js"],"names":["hasClass","addClass","element","className","classList","add","setAttribute","baseVal"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,YAArB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,SAASC,QAAT,CAAkBC,OAAlB,EAA2BC,SAA3B,EAAsC;AACnD,MAAID,OAAO,CAACE,SAAZ,EAAuBF,OAAO,CAACE,SAAR,CAAkBC,GAAlB,CAAsBF,SAAtB,EAAvB,KAA6D,IAAI,CAACH,QAAQ,CAACE,OAAD,EAAUC,SAAV,CAAb,EAAmC,IAAI,OAAOD,OAAO,CAACC,SAAf,KAA6B,QAAjC,EAA2CD,OAAO,CAACC,SAAR,GAAoBD,OAAO,CAACC,SAAR,GAAoB,GAApB,GAA0BA,SAA9C,CAA3C,KAAwGD,OAAO,CAACI,YAAR,CAAqB,OAArB,EAA8B,CAACJ,OAAO,CAACC,SAAR,IAAqBD,OAAO,CAACC,SAAR,CAAkBI,OAAvC,IAAkD,EAAnD,IAAyD,GAAzD,GAA+DJ,SAA7F;AACzM","sourcesContent":["import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}"]},"metadata":{},"sourceType":"module"}
|