From e7306f2c4ad577fd94bbb28e1c7636ef6799bad7 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 26 Feb 2014 12:17:10 +0100 Subject: [FIX] fixes various problems with the graph view and the filters in the searchbar. Now, it should properly compute and update the groupby/col_groupby in the search bar (addon web_graph) bzr revid: ged@openerp.com-20140226111710-q11qx1tb2l0nryxf --- addons/web_graph/static/src/js/graph_widget.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web_graph/static/src/js/graph_widget.js') diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index 26f479790df..f060e62fa8c 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -37,6 +37,8 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ if (this.mode !== 'pivot') { this.$('.graph_heatmap label').addClass('disabled'); + } else { + this.$('.graph_main_content').css('position', 'initial'); } return this.model.call('fields_get', []).then(function (f) { @@ -159,8 +161,10 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ if (mode === 'pivot') { this.$('.graph_heatmap label').removeClass('disabled'); + this.$('.graph_main_content').css('position', 'initial'); } else { this.$('.graph_heatmap label').addClass('disabled'); + this.$('.graph_main_content').css('position', 'relative'); } this.display_data(); }, -- cgit v1.2.3 From eb1eb48ef39a7eabcf96a2d130ddf81c360b2b53 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 26 Feb 2014 14:04:24 +0100 Subject: [IMP] optimizes pivot table so that it doesn't reload data when the groupbys have been changed in such a way that it should only fold some headers (addon web_graph) bzr revid: ged@openerp.com-20140226130424-rtb5iof0c14caf56 --- addons/web_graph/static/src/js/graph_widget.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'addons/web_graph/static/src/js/graph_widget.js') diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index f060e62fa8c..9498fbfc93c 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -151,6 +151,13 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ return; } + if (!dom_changed && col_reduced && row_reduced) { + this.pivot.fold_with_depth(this.pivot.rows, row_gbs.length); + this.pivot.fold_with_depth(this.pivot.cols, col_gbs.length); + this.display_data(); + return; + } + if (dom_changed || row_gb_changed || col_gb_changed) { this.pivot.set(domain, row_gbs, col_gbs).then(this.proxy('display_data')); } -- cgit v1.2.3 From b453252c2dc10b8361b557229eec85b8684a6858 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 26 Feb 2014 15:39:19 +0100 Subject: [IMP] this commit adds two css classes (graph_pivot_mode and graph_chart_mode) to better separate the ui from the code in graph view (addon web_graph) bzr revid: ged@openerp.com-20140226143919-cejqoq2kd4iwrq04 --- addons/web_graph/static/src/js/graph_widget.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'addons/web_graph/static/src/js/graph_widget.js') diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index 9498fbfc93c..ac2a581616d 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -37,8 +37,9 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ if (this.mode !== 'pivot') { this.$('.graph_heatmap label').addClass('disabled'); + this.$('.graph_main_content').addClass('graph_chart_mode'); } else { - this.$('.graph_main_content').css('position', 'initial'); + this.$('.graph_main_content').addClass('graph_pivot_mode'); } return this.model.call('fields_get', []).then(function (f) { @@ -168,10 +169,10 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ if (mode === 'pivot') { this.$('.graph_heatmap label').removeClass('disabled'); - this.$('.graph_main_content').css('position', 'initial'); + this.$('.graph_main_content').removeClass('graph_chart_mode').addClass('graph_pivot_mode'); } else { this.$('.graph_heatmap label').addClass('disabled'); - this.$('.graph_main_content').css('position', 'relative'); + this.$('.graph_main_content').removeClass('graph_pivot_mode').addClass('graph_chart_mode'); } this.display_data(); }, -- cgit v1.2.3 From a37f96d0438e8ab3984f659110004c19c9f01013 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 26 Feb 2014 15:40:32 +0100 Subject: [FIX] adds a missing semicolon... :/ (addon web_graph) bzr revid: ged@openerp.com-20140226144032-st0eqbkzco8n2unk --- addons/web_graph/static/src/js/graph_widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_graph/static/src/js/graph_widget.js') diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index ac2a581616d..78fa7ceff22 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -376,7 +376,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ this.$('.graph_main_content svg').remove(); this.$('.graph_main_content div').remove(); this.table.empty(); - this.table.toggleClass('heatmap', this.heatmap_mode !== 'none') + this.table.toggleClass('heatmap', this.heatmap_mode !== 'none'); this.width = this.$el.width(); this.height = Math.min(Math.max(document.documentElement.clientHeight - 116 - 60, 250), Math.round(0.8*this.$el.width())); -- cgit v1.2.3