summaryrefslogtreecommitdiff
path: root/addons/base/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-06-08 15:51:41 +0200
committerXavier Morel <xmo@openerp.com>2011-06-08 15:51:41 +0200
commita905ab7f178ee082642c4d7bf9908cdb3d69fd3d (patch)
tree1c7d1a0612781a0b2e9e3437b18f71d806c42b80 /addons/base/static/src
parentf824cd6aa3589838b0fe5bccd6455131c81845e8 (diff)
[IMP] don't wait for the bloody record to be fully loaded to fixup cell styles and add groupby columns (in case of grouping), it makes the list titles jittery which looks terrible. Instead, can fixup the row right after rendering, which makes the whole thing much stabler
bzr revid: xmo@openerp.com-20110608135141-g6rz1g77ykyg2cja
Diffstat (limited to 'addons/base/static/src')
-rw-r--r--addons/base/static/src/js/list-editable.js35
1 files changed, 16 insertions, 19 deletions
diff --git a/addons/base/static/src/js/list-editable.js b/addons/base/static/src/js/list-editable.js
index fd20a51c0ef..9bbde25a74d 100644
--- a/addons/base/static/src/js/list-editable.js
+++ b/addons/base/static/src/js/list-editable.js
@@ -158,26 +158,23 @@ openerp.base.list.editable = function (openerp) {
template: 'ListView.row.form',
registry: openerp.base.list.form.widgets
});
- this.edition_form.on_loaded({fields_view: this.get_fields_view()});
- this.edition_form.on_record_loaded.add({
- position: 'last',
- unique: true,
- callback: function () {
- var $e = self.edition_form.$element;
- $e.find('td')
- .addClass('oe-field-cell')
- .removeAttr('width')
- .end()
- .find('td:first').removeClass('oe-field-cell').end()
- .find('td:last').removeClass('oe-field-cell').end();
- _(self.columns).each(function (column) {
- if (column.meta) {
- $e.prepend('<td>');
- }
- });
- }
+ $.when(this.edition_form.on_loaded({fields_view: this.get_fields_view()})).then(function () {
+ // put in $.when just in case FormView.on_loaded becomes asynchronous
+ $new_row.find('td')
+ .addClass('oe-field-cell')
+ .removeAttr('width')
+ .end()
+ .find('td:first').removeClass('oe-field-cell').end()
+ .find('td:last').removeClass('oe-field-cell').end();
+ // pad in case of groupby
+ _(self.columns).each(function (column) {
+ if (column.meta) {
+ $new_row.prepend('<td>');
+ }
+ });
+
+ self.edition_form.do_show();
});
- this.edition_form.do_show();
},
/**
* Saves the current row, and triggers the edition of its following