[FIX] qweb: fix overlapping multi-class in t-att-class

Previously, if two attributes in t-att-class shared some classes, their
presence would be determined by the last attribute declared, instead of
being present if any attribute containing it evaluates to true. This
commit fixes that.
This commit is contained in:
Samuel Degueldre
2021-08-30 11:29:00 +02:00
committed by Géry Debongnie
parent 9fe2da704e
commit b242230e20
3 changed files with 39 additions and 2 deletions
+2 -2
View File
@@ -127,12 +127,12 @@ const UTILS: Utils = {
return result;
}
// this is already an object, but we may need to split keys:
// {'a': true, 'b c': true} should become {a: true, b: true, c: true}
// {'a b': true, 'a c': false} should become {a: true, b: true, c: false}
for (let key in expr) {
const value = expr[key];
const words = key.split(/\s+/);
for (let word of words) {
result[word] = value;
result[word] = result[word] || value;
}
}
return result;