diff options
| author | Vaibhav (OpenERP) <vda@tinyerp.com> | 2011-11-23 15:59:17 +0530 |
|---|---|---|
| committer | Vaibhav (OpenERP) <vda@tinyerp.com> | 2011-11-23 15:59:17 +0530 |
| commit | cc36c7c401da4e38837ba63052ef72120ae072ca (patch) | |
| tree | c09697c6cced928732da6f3a5c52a57c27b8a791 /addons/web_graph/static/src | |
| parent | 15b357cb79a7243a74515bd7596c385e9b8e0c6a (diff) | |
| parent | 8501aecd3bda0075295e9b4db2febd404cd39ca3 (diff) | |
[MERGE] trunk.
bzr revid: vda@tinyerp.com-20111123102917-w5tbmo4fox75t6mz
Diffstat (limited to 'addons/web_graph/static/src')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 04e9d77f5d0..f940cac8b0b 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -187,7 +187,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ schedule_bar: function(results) { var self = this; - var group_list, view_chart; if (!this.group_field) { view_chart = (this.orientation === 'horizontal') ? 'barH' : 'bar'; @@ -220,7 +219,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ .map(function (value, index) { return { group: self.ordinate + '_' + - value.toLowerCase().replace(/\s/g, '_'), + value.toLowerCase().replace(/[\s\/]+/g,'_'), text: value, color: COLOR_PALETTE[index % COLOR_PALETTE.length] }; @@ -233,23 +232,21 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ // second argument is coerced to a str, no good for boolean r[self.abscissa] = records[0][self.abscissa]; _(records).each(function (record) { - var key = _.sprintf('%s_%s', + var key = _.str.sprintf('%s_%s', self.ordinate, - record[self.group_field].toLowerCase().replace(/\s/g, '_')); + record[self.group_field].toLowerCase().replace(/[\s\/]+/g,'_')); r[key] = record[self.ordinate]; }); return r; }) .value(); } - var abscissa_description = { title: "<b>" + this.fields[this.abscissa].string + "</b>", template: function (obj) { return obj[self.abscissa] || 'Undefined'; } }; - var ordinate_description = { lines: true, title: "<b>" + this.fields[this.ordinate].string + "</b>" @@ -263,7 +260,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ x_axis = abscissa_description; y_axis = ordinate_description; } - var renderer = function () { if (self.$element.is(':hidden')) { self.renderer = setTimeout(renderer, 100); @@ -278,7 +274,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ border: false, width: 1024, tooltip:{ - template: _.sprintf("#%s#, %s=#%s#", + template: _.str.sprintf("#%s#, %s=#%s#", self.abscissa, group_list[0].text, group_list[0].group) }, radius: 0, @@ -306,7 +302,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ bar_chart.addSeries({ value: "#"+column.group+"#", tooltip:{ - template: _.sprintf("#%s#, %s=#%s#", + template: _.str.sprintf("#%s#, %s=#%s#", self.abscissa, column.text, column.group) }, color: column.color @@ -373,9 +369,8 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ }, open_list_view : function (id){ var self = this; - if($(".dhx_tooltip").is(":visible")) { - $(".dhx_tooltip").remove('div'); - } + // unconditionally nuke tooltips before switching view + $(".dhx_tooltip").remove('div'); id = id[this.abscissa]; if (typeof id == 'object'){ id = id[0]; |
