summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorGaurav Panchal <gan@openerp.com>2015-08-13 17:33:37 +0200
committerThibault Delavallée <tde@openerp.com>2015-08-14 09:48:19 +0200
commit36e62924668bcd0d19b0ef4712349848251ad1ef (patch)
treef6ce97f1b0fdc454450664c3be6d88a526455ed9 /addons
parent19a252d578d4f5de0a5853f1a79b3d0ad49b5a8d (diff)
[FIX] web: radio horizontal
The widget was completely broken when usign the horizontal display. It has been fixed, hopefully in a way that lessen the xml and css.
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/css/base.css9
-rw-r--r--addons/web/static/src/css/base.sass6
-rw-r--r--addons/web/static/src/xml/base.xml24
3 files changed, 11 insertions, 28 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index a9d05b17bb2..637718e31d5 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -558,13 +558,12 @@
background: #7C7BAD;
color: #eee;
}
-.openerp .oe_form_field_radio.oe_horizontal {
- white-space: nowrap;
-}
.openerp .oe_form_field_radio.oe_horizontal label {
display: inline-block;
- text-align: center;
- height: 16px;
+ margin-left: 20px;
+}
+.openerp .oe_form_field_radio.oe_horizontal > span > div {
+ display: inline-block;
}
.openerp .oe_form_field_radio.oe_vertical label {
display: inline-block;
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index c665269bcfe..644cdb4081b 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -509,11 +509,11 @@ $sheet-padding: 16px
color: #eee
.oe_form_field_radio
&.oe_horizontal
- white-space: nowrap
label
display: inline-block
- text-align: center
- height: 16px
+ margin-left: 20px
+ > span > div
+ display: inline-block
&.oe_vertical
label
display: inline-block
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index aba01929158..2ad307f7a1d 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -881,26 +881,10 @@
<t t-name="FieldRadio">
<span t-attf-class="oe_form_field oe_form_field_radio #{widget.options.horizontal ? 'oe_horizontal' : 'oe_vertical'}" t-att-style="widget.node.attrs.style">
<span t-if="!widget.get('effective_readonly')">
- <t t-if="widget.options.horizontal">
- <t t-set="width" t-value="Math.floor(100 / widget.selection.length)"/>
- <t t-if="!widget.options.no_radiolabel">
- <t t-foreach="widget.selection" t-as="selection">
- <label t-att-for="widget.uniqueId + '_' + selection[0]" t-att-style="'width: ' + width + '%;'"><t t-esc="selection[1]"/></label>
- </t>
- <br/>
- </t>
- <t t-foreach="widget.selection" t-as="selection">
- <div t-att-style="'width: ' + width + '%;'">
- <span class="oe_radio_input"><input type="radio" t-att-name="widget.uniqueId" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-value="selection[0]"/></span>
- </div>
- </t>
- </t>
- <t t-if="!widget.options.horizontal">
- <t t-foreach="widget.selection" t-as="selection">
- <div>
- <span class="oe_radio_input"><input type="radio" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-name="widget.uniqueId" t-att-value="selection[0]"/></span><label t-if="!widget.options.no_radiolabel" t-att-for="widget.uniqueId + '_' + selection[0]"><t t-esc="selection[1]"/></label>
- </div>
- </t>
+ <t t-foreach="widget.selection" t-as="selection">
+ <div>
+ <span class="oe_radio_input"><input type="radio" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-name="widget.uniqueId" t-att-value="selection[0]"/></span><label t-if="!widget.options.no_radiolabel" t-att-for="widget.uniqueId + '_' + selection[0]"><t t-esc="selection[1]"/></label>
+ </div>
</t>
</span>
<span t-if="widget.get('effective_readonly')" class="oe_radio_readonly"><t t-esc="widget.get('value')[1]"/></span>