Skip to content
Snippets Groups Projects
Commit 49de0f46 authored by Xavier Morel's avatar Xavier Morel
Browse files

[FIX] stupidity: if insert a line in a list with more than 5 records (no...

[FIX] stupidity: if insert a line in a list with more than 5 records (no padding), since the new line does not have a @data-id yet it's going to remove it immediately.

select line to remove before inserting new one

bzr revid: xmo@openerp.com-20111004155746-q13ieg0q6lsy1uf7
parent 74db7dd0
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,7 @@ openerp.web.list_editable = function (openerp) {
var $new_row = $('<tr>', {
id: _.uniqueId('oe-editable-row-'),
'data-id': record_id,
'class': $(row).attr('class') + ' oe_forms',
'class': row ? $(row).attr('class') : '' + ' oe_forms',
click: function (e) {e.stopPropagation();}
})
.delegate('button.oe-edit-row-save', 'click', function () {
......@@ -175,6 +175,7 @@ openerp.web.list_editable = function (openerp) {
if (row) {
$new_row.replaceAll(row);
} else if (self.options.editable) {
var $last_child = self.$current.find('> tr:last');
if (self.records.length) {
if (self.options.editable === 'top') {
$new_row.insertBefore(
......@@ -186,7 +187,6 @@ openerp.web.list_editable = function (openerp) {
} else {
$new_row.prependTo(self.$current);
}
var $last_child = self.$current.find('> tr:last');
if ($last_child.is(':not([data-id])')) {
$last_child.remove();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment