mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: properly handle empty class attribute
The classList.add method actually crashes when given an empty string (or a string with just white spaces). closes #530
This commit is contained in:
@@ -44,6 +44,30 @@ exports[`attributes dynamic attributes 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`attributes dynamic class attribute 1`] = `
|
||||
"function anonymous(context,extra
|
||||
) {
|
||||
let utils = this.constructor.utils;
|
||||
var h = this.h;
|
||||
let _1 = utils.toObj(context['c']);
|
||||
let c2 = [], p2 = {key:2,class:_1};
|
||||
var vn2 = h('div', p2, c2);
|
||||
return vn2;
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`attributes dynamic empty class attribute 1`] = `
|
||||
"function anonymous(context,extra
|
||||
) {
|
||||
let utils = this.constructor.utils;
|
||||
var h = this.h;
|
||||
let _1 = utils.toObj(context['c']);
|
||||
let c2 = [], p2 = {key:2,class:_1};
|
||||
var vn2 = h('div', p2, c2);
|
||||
return vn2;
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`attributes dynamic formatted attributes with a dash 1`] = `
|
||||
"function anonymous(context,extra
|
||||
) {
|
||||
@@ -787,6 +811,29 @@ exports[`special cases for some boolean html attributes/properties various boole
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`static templates div with a class attribute 1`] = `
|
||||
"function anonymous(context,extra
|
||||
) {
|
||||
var h = this.h;
|
||||
let _2 = {'abc':true};
|
||||
let c3 = [], p3 = {key:3,class:_2};
|
||||
var vn3 = h('div', p3, c3);
|
||||
c3.push({text: \`word\`});
|
||||
return vn3;
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`static templates div with a empty class attribute 1`] = `
|
||||
"function anonymous(context,extra
|
||||
) {
|
||||
var h = this.h;
|
||||
let c2 = [], p2 = {key:2};
|
||||
var vn2 = h('div', p2, c2);
|
||||
c2.push({text: \`word\`});
|
||||
return vn2;
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`static templates div with a span child node 1`] = `
|
||||
"function anonymous(context,extra
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user