summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-03-09 14:50:45 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit3f147cbfa04ad596a10a211baad8f958e47959ee (patch)
treec7562b71947b05b91e93f912f99db2da35d54fb7 /addons/web/static/src
parent9fb1228b6ce0dd254c8dd88c7beff65579301af9 (diff)
[FIX] web: list editable: no flicker when editing
The test checking that the cells width remains the same when entering the edition mode was broken, because we didn't hardcode the width for readonly cells. This commit ensures that we force the width of all the cells of the edited row.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/list/list_editable_renderer.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/list/list_editable_renderer.js b/addons/web/static/src/js/views/list/list_editable_renderer.js
index 38b3066a4d3..b486f6f592c 100644
--- a/addons/web/static/src/js/views/list/list_editable_renderer.js
+++ b/addons/web/static/src/js/views/list/list_editable_renderer.js
@@ -263,10 +263,6 @@ ListRenderer.include({
return;
}
var $td = this._findTd($row, colIndex);
- // force the width of the cell to its current value so that it won't
- // change if its content changes (to prevent the list view from
- // flickering).
- $td.width($td.width());
var widget_keys = ['list.' + field.type, field.type];
if (node.attrs.widget) {
widget_keys.unshift(node.attrs.widget);
@@ -385,6 +381,12 @@ ListRenderer.include({
// instantiate column widgets
var $row = this.$('tbody tr').eq(rowIndex);
$row.addClass('o_selected_row');
+ // force the width of each cell to its current value so that it won't
+ // change if its content changes, to prevent the view from flickering
+ $row.find('td').each(function () {
+ var $td = $(this);
+ $td.width($td.width());
+ });
_.each(this.columns, function (node, index) {
var widget = self._renderFieldWidget($row, node, rowIndex, index);