From c9f81943de58f7ea2cc2c869b3a888e81476256f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 9 Jun 2014 18:24:51 +0200 Subject: [PATCH] Manage correctly xalign for label review12361002 --- src/sao.less | 1 - src/view.js | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sao.less b/src/sao.less index e7b03ed105..a441926982 100644 --- a/src/sao.less +++ b/src/sao.less @@ -101,7 +101,6 @@ body { width: 100%; } & td.form-label { - text-align: right; white-space: nowrap; } & .form-many2one, .form-date, .form-binary, .form-reference { diff --git a/src/view.js b/src/view.js index 2e7611b59b..64896d03bf 100644 --- a/src/view.js +++ b/src/view.js @@ -1208,8 +1208,8 @@ text = model.fields[name] .description.string + ':'; } - if (node.getAttribute('xalign') === undefined) { - node.setAttribute('xalign', 1.0); + if (attributes.xalign === undefined) { + attributes.xalign = 1.0; } } else if (!text) { // TODO get content @@ -1455,8 +1455,12 @@ } var cell = jQuery('', { 'colspan': colspan, - 'class': widget ? widget.class_ || '' : '' + 'class': widget ? widget.class_ || '' : '', }).append(el); + if (attributes.xalign !== undefined) { + // TODO replace by start/end when supported + cell.css('text-align', attributes.xalign >= 0.5? 'right': 'left'); + } if (xexpand) { cell.addClass('xexpand'); cell.css('width', '100%');