[FIX] Fix layouting width issue

bzr revid: fme@openerp.com-20120320120621-jk4ojmz925veym1v
This commit is contained in:
Fabien Meghazi 2012-03-20 13:06:21 +01:00
parent d76e8be574
commit 64f940f212
3 changed files with 6 additions and 3 deletions

View File

@ -361,6 +361,7 @@
}
.openerp2 .oe_layout_debugging .oe_form_group_cell {
border: 1px solid blue;
padding-bottom: 1em;
}
.openerp2 .oe_layout_debugging .oe_layout_debug_cell {
position: absolute;

View File

@ -351,6 +351,7 @@ $colour4: #8a89ba
border: 1px solid red
.oe_form_group_cell
border: 1px solid blue
padding-bottom: 1em
.oe_layout_debug_cell
position: absolute
color: white

View File

@ -846,6 +846,7 @@ openerp.web.FormRenderingEngine = openerp.web.Widget.extend({
// Now compute width of cells
$table.find('tbody > tr').each(function() {
var to_compute = [],
row_cols = cols,
total = 100;
$(this).children().each(function() {
var $td = $(this),
@ -855,13 +856,13 @@ openerp.web.FormRenderingEngine = openerp.web.Widget.extend({
if ($child.attr('orientation') === 'vertical') {
$td.addClass('oe_vertical_separator').attr('width', '1');
$td.empty();
cols--;
row_cols--;
}
break;
case 'label':
if ($child.attr('for')) {
$td.attr('width', '1%');
cols--;
row_cols--;
total--;
}
break;
@ -869,7 +870,7 @@ openerp.web.FormRenderingEngine = openerp.web.Widget.extend({
to_compute.push($td);
}
});
var unit = Math.floor(total / cols);
var unit = Math.floor(total / row_cols);
_.each(to_compute, function($td, i) {
var width = parseInt($td.attr('colspan'), 10) * unit;
$td.attr('width', ((i == to_compute.length - 1) ? total : width) + '%');