[ADD] Added percentage in progressbar (can't center it for the moment)
bzr revid: fme@openerp.com-20110509141001-33vihmt5edam0ydq
This commit is contained in:
parent
2e760b3699
commit
93d7852342
|
@ -648,6 +648,12 @@ body.openerp {
|
|||
background-color: #F66;
|
||||
border: 1px solid #D00;
|
||||
}
|
||||
.openerp div.oe-progressbar span {
|
||||
position: absolute;
|
||||
margin-left: 10px;
|
||||
margin-top: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* jQuery UI override */
|
||||
.openerp .ui-widget {
|
||||
|
|
|
@ -773,6 +773,14 @@ openerp.base.form.FieldProgressBar = openerp.base.form.Field.extend({
|
|||
value: this.value,
|
||||
disabled: this.readonly
|
||||
});
|
||||
},
|
||||
set_value: function(value) {
|
||||
this._super.apply(this, arguments);
|
||||
var show_value = Number(value);
|
||||
if (show_value === NaN) {
|
||||
show_value = 0;
|
||||
}
|
||||
this.$element.find('div').progressbar('option', 'value', show_value).find('span').html(show_value + '%');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -365,7 +365,9 @@
|
|||
t-att-class="'field_' + widget.type"/>
|
||||
</t>
|
||||
<t t-name="FieldProgressBar">
|
||||
<div t-opentag="true"></div>
|
||||
<div t-opentag="true" class="oe-progressbar">
|
||||
<span></span>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="WidgetButton">
|
||||
<button type="button"
|
||||
|
|
Loading…
Reference in New Issue