diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-03-17 16:27:10 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-03-17 16:27:10 +0100 |
| commit | e8198d74b68c3f1fba677b596a2eedf60af8ad83 (patch) | |
| tree | e0d5f932dbc753f371b2aecdc37f9001ebae06bc /addons/web/static/src/js | |
| parent | af61fd53bc86583aca872d4d884e976fed885d30 (diff) | |
[IMP] various tweaks to stat_button, to fix issues mentioned in code review. This is mostly cosmetic cleanups, only notable change is that stat_button is now a proper html button instead of a label (addon web)
bzr revid: ged@openerp.com-20140317152710-c33q8kua33o001la
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index c4bddd90f34..969e0150737 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1916,8 +1916,8 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ template: 'WidgetButton', init: function(field_manager, node) { node.attrs.type = node.attrs['data-button-type']; - this.is_stat_button = node.attrs.class ? _.include(node.attrs.class.split(' '), 'oe_stat_button') : false; - this.icon = "<span class=\"fa " + node.attrs.icon + "\"></span>"; + this.is_stat_button = /\boe_stat_button\b/.test(node.attrs['class']); + this.icon = node.attrs.icon && "<span class=\"fa " + node.attrs.icon + "\"></span>"; this._super(field_manager, node); this.force_disabled = false; this.string = (this.node.attrs.string || '').replace(/_/g, ''); @@ -2845,16 +2845,12 @@ instance.web.form.FieldPercentPie = instance.web.form.AbstractField.extend({ .datum([{'x': 'value', 'y': value}, {'x': 'complement', 'y': 100 - value}]) .transition() .call(chart) - .attr('width', size) - .attr('height',size); + .attr({width:size, height:size}); d3.select(svg) .append("text") - .attr("x", size/2) - .attr("y", size/2 + 3) - .style("font-size", "10px") - .style("font-weight", "bold") - .attr("text-anchor", "middle") + .attr({x: size/2, y: size/2 + 3, 'text-anchor': 'middle'}) + .style({"font-size": "10px", "font-weight": "bold"}) .text(formatted_value); return chart; @@ -5923,7 +5919,7 @@ instance.web.form.StatInfo = instance.web.form.AbstractField.extend({ }, render_value: function() { var text = _.str.sprintf("%d %s", this.get("value") || 0, this.string); - this.$().html(QWeb.render("StatInfo", {text: text})); + this.$el.html(QWeb.render("StatInfo", {text: text})); }, }); |
