[imp] now status widget correctly highlights the selected item
bzr revid: nicolas.vanhoren@openerp.com-20110908154551-oti347kv6f7h0q2y
This commit is contained in:
parent
38df96f124
commit
c2ad26f34c
|
@ -2482,12 +2482,13 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({
|
|||
template: "FieldStatus",
|
||||
start: function() {
|
||||
this._super();
|
||||
this.selected_item = null;
|
||||
this.selected_index = null;
|
||||
this.render_list();
|
||||
},
|
||||
set_value: function(value) {
|
||||
this._super(value);
|
||||
this.selected_item = value;
|
||||
var select = _.detect(this.field.selection, function(x) { return x[0] === value; });
|
||||
this.selected_index = _.indexOf(this.field.selection, select);
|
||||
this.render_list();
|
||||
},
|
||||
render_list: function() {
|
||||
|
|
|
@ -1384,7 +1384,7 @@
|
|||
<ul class="oe-arrow-list">
|
||||
<t t-set="size" t-value="widget.field.selection.length"/>
|
||||
<t t-foreach="_.range(size)" t-as="i">
|
||||
<li>
|
||||
<li t-att-class="i === widget.selected_index ? 'oe-arrow-list-selected' : ''">
|
||||
<span class="oe-arrow-list-before" t-if="i > 0"></span><span><t t-esc="widget.field.selection[i][1]"/></span><span class="oe-arrow-list-after" t-if="i < size - 1"></span>
|
||||
</li>
|
||||
</t>
|
||||
|
|
Loading…
Reference in New Issue