mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: do not override t-att-class with class
There was some code in qweb to make sure that we support setting class
and t-att-class on the same html element:
<div class="some class" t-att-class="{b: true}">...</div>
But the code did not work in the other direction:
<div t-att-class="{b: true}" class="some class">...</div>
With this commit, we just add the missing if statement
closes #664
This commit is contained in:
+6
-2
@@ -704,8 +704,12 @@ export class QWeb extends EventBus {
|
||||
.split(/\s+/)
|
||||
.map(a => `'${escapeQuotes(a)}':true`)
|
||||
.join(",");
|
||||
classObj = `_${ctx.generateID()}`;
|
||||
ctx.addLine(`let ${classObj} = {${classDef}};`);
|
||||
if (classObj) {
|
||||
ctx.addLine(`Object.assign(${classObj}, {${classDef}})`);
|
||||
} else {
|
||||
classObj = `_${ctx.generateID()}`;
|
||||
ctx.addLine(`let ${classObj} = {${classDef}};`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ctx.addLine(`let _${attID} = '${escapeQuotes(value)}';`);
|
||||
|
||||
Reference in New Issue
Block a user