summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/graph.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2013-12-06 17:04:11 +0100
committerGery Debongnie <ged@openerp.com>2013-12-06 17:04:11 +0100
commit5c04caf2ee2050bb0607f3ebf066e744b398d21f (patch)
treefbfed619988f2ddcd7d39844493ad93e8d48d77b /addons/web_graph/static/src/js/graph.js
parent6a06f0d0eeee1efe7417d3a73eb2e4b8661d73d6 (diff)
[REF] many small code cleanups in addon web_graph
bzr revid: ged@openerp.com-20131206160411-9ajcschidssftb49
Diffstat (limited to 'addons/web_graph/static/src/js/graph.js')
-rw-r--r--addons/web_graph/static/src/js/graph.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index 344899032d6..8cf0ffd4877 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -38,7 +38,6 @@ instance.web_graph.GraphView = instance.web.View.extend({
this.set_default_options(options);
this.dropdown = null;
this.mode = 'pivot'; // pivot, bar_chart, line_chart, pie_chart, heatmap, row_heatmap, col_heatmap
- this.measure = null;
this.measure_list = [];
this.important_fields = [];
this.search_view = parent.searchview;
@@ -125,9 +124,6 @@ instance.web_graph.GraphView = instance.web.View.extend({
if (group_by.length || col_groupby.length) {
this.groupby_mode = 'manual';
- // if (!group_by.length) {
- // group_by = this.default_row_groupby;
- // }
}
this.pivot_table.set_domain(domain);
@@ -214,7 +210,6 @@ instance.web_graph.GraphView = instance.web.View.extend({
var mode = event.target.attributes['data-mode'].nodeValue;
this.mode = mode;
this.display_data();
-
},
register_groupby: function() {
@@ -222,7 +217,6 @@ instance.web_graph.GraphView = instance.web.View.extend({
query = this.search_view.query;
this.groupby_mode = 'manual';
-
var rows = _.map(this.pivot_table.rows.groupby, function (group) {
return make_facet('GroupBy', group);
});
@@ -259,8 +253,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
measure_selection: function (event) {
event.preventDefault();
var measure = event.target.attributes['data-choice'].nodeValue;
- this.measure = (measure === '__count') ? null : measure;
- this.pivot_table.set_measure(this.measure);
+ this.pivot_table.set_measure((measure === '__count') ? null : measure);
this.display_data();
},
@@ -276,7 +269,8 @@ instance.web_graph.GraphView = instance.web.View.extend({
this.register_groupby();
break;
case 'fold_all':
- this.pivot_table.fold_all();
+ this.pivot_table.fold_cols();
+ this.pivot_table.fold_rows();
this.register_groupby();
break;
case 'expand_all':
@@ -287,7 +281,6 @@ instance.web_graph.GraphView = instance.web.View.extend({
},
option_selection: function (event) {
- var pivot = this.pivot_table;
event.preventDefault();
switch (event.target.attributes['data-choice'].nodeValue) {
case 'swap_axis':
@@ -299,7 +292,6 @@ instance.web_graph.GraphView = instance.web.View.extend({
this.display_data();
break;
case 'export_data':
- this.register_groupby();
// Export code... To do...
break;
}
@@ -353,7 +345,8 @@ instance.web_graph.GraphView = instance.web.View.extend({
},
measure_label: function () {
- return (this.measure) ? this.fields[this.measure].string : 'Quantity';
+ var pivot = this.pivot_table;
+ return (pivot.measure) ? this.fields[pivot.measure].string : 'Quantity';
},
make_border_cell: function (colspan, rowspan) {