[IMP] Improved rendering engine group cells width computing
authorFabien Meghazi <fme@openerp.com>
Thu, 19 Apr 2012 15:33:41 +0000 (17:33 +0200)
committerFabien Meghazi <fme@openerp.com>
Thu, 19 Apr 2012 15:33:41 +0000 (17:33 +0200)
bzr revid: fme@openerp.com-20120419153341-gequ3826z6fd44x6

addons/web/static/src/css/base.css
addons/web/static/src/css/base.sass
addons/web/static/src/js/view_form.js

index 854946c..2b90d47 100644 (file)
   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;
 }
index 98caeaf..fc645a9 100644 (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
index a87982f..c13e283 100644 (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);