[FIX] web: List: handle custom class on button
It should be possible to set a custom class on a button in the list view. Closes #20620
This commit is contained in:
@@ -307,7 +307,7 @@ var ListRenderer = BasicRenderer.extend({
|
||||
} else {
|
||||
$button.text(node.attrs.string);
|
||||
}
|
||||
|
||||
this._handleAttributes($button, node);
|
||||
this._registerModifiers(node, record, $button);
|
||||
|
||||
if (record.res_id) {
|
||||
|
||||
@@ -1088,7 +1088,7 @@ QUnit.module('Views', {
|
||||
});
|
||||
|
||||
QUnit.test('can display button in edit mode', function (assert) {
|
||||
assert.expect(1);
|
||||
assert.expect(2);
|
||||
|
||||
var list = createView({
|
||||
View: ListView,
|
||||
@@ -1096,10 +1096,11 @@ QUnit.module('Views', {
|
||||
data: this.data,
|
||||
arch: '<tree editable="bottom">' +
|
||||
'<field name="foo"/>' +
|
||||
'<button name="notafield" type="object" icon="fa-asterisk"/>' +
|
||||
'<button name="notafield" type="object" icon="fa-asterisk" class="o_yeah"/>' +
|
||||
'</tree>',
|
||||
});
|
||||
assert.ok(list.$('tbody button').length, "should have a button");
|
||||
assert.ok(list.$('tbody button').hasClass('o_yeah'), "class should be set on the button");
|
||||
list.destroy();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user