Fix the code style issue to pass eslint

pull/7926/head
wubaiqing 2017-11-01 11:19:08 +08:00 committed by 杨奕
parent 2c34b3c804
commit 98bf5d7f28
1 changed files with 4 additions and 8 deletions

View File

@ -86,12 +86,10 @@ export function addClass(el, cls) {
if (el.classList) {
el.classList.add(clsName);
} else {
if (!hasClass(el, clsName)) {
} else if (hasClass(el, clsName)) {
curClass += ' ' + clsName;
}
}
}
if (!el.classList) {
el.className = curClass;
}
@ -109,12 +107,10 @@ export function removeClass(el, cls) {
if (el.classList) {
el.classList.remove(clsName);
} else {
if (hasClass(el, clsName)) {
} else if (hasClass(el, clsName)) {
curClass = curClass.replace(' ' + clsName + ' ', ' ');
}
}
}
if (!el.classList) {
el.className = trim(curClass);
}