[IMP] Improved rendering engine group cells width computing

bzr revid: fme@openerp.com-20120419153341-gequ3826z6fd44x6
This commit is contained in:
Fabien Meghazi 2012-04-19 17:33:41 +02:00
parent a6bc55c95c
commit 5afd20a530
3 changed files with 21 additions and 3 deletions

View File

@ -1783,11 +1783,14 @@
font-weight: bold;
}
.openerp .oe_layout_debugging .oe_form_group {
outline: 2px dashed red;
outline: 2px dashed green;
}
.openerp .oe_layout_debugging .oe_form_group_cell {
outline: 1px solid blue;
}
.openerp .oe_layout_debugging .oe_form_group:hover, .openerp .oe_layout_debugging .oe_form_group_cell:hover {
outline-color: red;
}
.openerp .oe_debug_view {
float: left;
}

View File

@ -1490,9 +1490,11 @@ $colour4: #8a89ba
// Debugging stuff {{{
.oe_layout_debugging
.oe_form_group
outline: 2px dashed red
outline: 2px dashed green
.oe_form_group_cell
outline: 1px solid blue
.oe_form_group:hover, .oe_form_group_cell:hover
outline-color: red
.oe_debug_view
float: left

View File

@ -1119,7 +1119,20 @@ instance.web.form.FormRenderingEngine = instance.web.Class.extend({
}
break;
default:
to_compute.push($td);
var width = _.str.trim($child.attr('width') || ''),
iwidth = parseInt(width, 10);
if (iwidth) {
if (width.substr(-1) === '%') {
total -= iwidth;
width = iwidth + '%';
}
$td.attr('width', width);
$child.removeAttr('width');
row_cols--;
} else {
to_compute.push($td);
}
}
});
var unit = Math.floor(total / row_cols);