Fixed class diffing

This commit is contained in:
Eduard Urbach 2017-10-08 09:03:55 +02:00
parent b8f52e1217
commit 405999d042

View File

@ -99,13 +99,18 @@ export class Diff {
let classesA = elemA.classList
let classesB = elemB.classList
let removeClasses: string[] = []
for(let className of classesA) {
if(!classesB.contains(className) && !Diff.persistentClasses.has(className)) {
classesA.remove(className)
removeClasses.push(className)
}
}
for(let className of removeClasses) {
classesA.remove(className)
}
for(let className of classesB) {
if(!classesA.contains(className)) {
classesA.add(className)