- // Now compute width of cells
- // Note FP: It would be better to remove this, using width="50%" rather than colspan="2"
- // $table.find('> tbody > tr').each(function() {
- // var to_compute = [],
- // row_cols = cols,
- // total = 100;
- // $(this).children().each(function() {
- // var $td = $(this),
- // $child = $td.children(':first');
- // switch ($child[0].tagName.toLowerCase()) {
- // case 'separator':
- // if ($child.attr('orientation') === 'vertical') {
- // $td.addClass('oe_vertical_separator').attr('width', '1');
- // $td.empty();
- // row_cols--;
- // }
- // break;
- // case 'label':
- // if ($child.attr('for')) {
- // $td.attr('width', '1%').addClass('oe_form_group_cell_label');
- // row_cols--;
- // total--;
- // }
- // break;
- // default:
- // var width = _.str.trim($child.attr('width') || ''),
- // iwidth = parseInt(width, 10);
- // if (iwidth) {
- // if (width.substr(-1) === '%') {
- // total -= iwidth;
- // width = iwidth + '%';
- // } else {
- // // Absolute width
- // $td.css('min-width', width + 'px');
- // }
- // $td.attr('width', width);
- // $child.removeAttr('width');
- // row_cols--;
- // } else {
- // to_compute.push($td);
- // }
+ $table.find('> tbody > tr').each(function() {
+ var to_compute = [],
+ row_cols = cols,
+ total = 100;
+ $(this).children().each(function() {
+ var $td = $(this),
+ $child = $td.children(':first');
+ switch ($child[0].tagName.toLowerCase()) {
+ case 'separator':
+ if ($child.attr('orientation') === 'vertical') {
+ $td.addClass('oe_vertical_separator').attr('width', '1');
+ $td.empty();
+ row_cols--;
+ }
+ break;
+ case 'label':
+ if ($child.attr('for')) {
+ $td.attr('width', '1%').addClass('oe_form_group_cell_label');
+ row_cols--;
+ total--;
+ }
+ break;
+ default:
+ var width = _.str.trim($child.attr('width') || ''),
+ iwidth = parseInt(width, 10);
+ if (iwidth) {
+ if (width.substr(-1) === '%') {
+ total -= iwidth;
+ width = iwidth + '%';
+ } else {
+ // Absolute width
+ $td.css('min-width', width + 'px');
+ }
+ $td.attr('width', width);
+ $child.removeAttr('width');
+ row_cols--;
+ } else {
+ to_compute.push($td);
+ }