提交 688b96f7 编写于 作者: J Johannes Rieken

fix #26021

上级 e66892f5
......@@ -160,20 +160,26 @@ const _manualClassList = new class {
const _nativeClassList = new class {
hasClass(node: HTMLElement, className: string): boolean {
return className && node.classList.contains(className);
return className && node.classList && node.classList.contains(className);
}
addClass(node: HTMLElement, className: string): void {
return className && node.classList.add(className);
if (className && node.classList) {
node.classList.add(className);
}
}
removeClass(node: HTMLElement, className: string): void {
return className && node.classList.remove(className);
if (className && node.classList) {
node.classList.remove(className);
}
}
toggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void {
if (node.classList) {
node.classList.toggle(className, shouldHaveIt);
}
}
};
// In IE11 there is only partial support for `classList` which makes us keep our
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册