fix #638
This commit is contained in:
parent
5aa9868512
commit
98d50d874d
@ -200,12 +200,12 @@ export interface ElementWithTransition extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function addTransitionClass(el: ElementWithTransition, cls: string) {
|
export function addTransitionClass(el: ElementWithTransition, cls: string) {
|
||||||
el.classList.add(cls)
|
cls.split(/\s+/).forEach(c => c && el.classList.add(c))
|
||||||
;(el._vtc || (el._vtc = new Set())).add(cls)
|
;(el._vtc || (el._vtc = new Set())).add(cls)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeTransitionClass(el: ElementWithTransition, cls: string) {
|
export function removeTransitionClass(el: ElementWithTransition, cls: string) {
|
||||||
el.classList.remove(cls)
|
cls.split(/\s+/).forEach(c => c && el.classList.remove(c))
|
||||||
if (el._vtc) {
|
if (el._vtc) {
|
||||||
el._vtc.delete(cls)
|
el._vtc.delete(cls)
|
||||||
if (!el._vtc!.size) {
|
if (!el._vtc!.size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user