From b453252c2dc10b8361b557229eec85b8684a6858 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 26 Feb 2014 15:39:19 +0100 Subject: [PATCH] [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/css/graph.css | 8 ++++++-- addons/web_graph/static/src/js/graph_widget.js | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/web_graph/static/src/css/graph.css b/addons/web_graph/static/src/css/graph.css index 2213f655a6b..1949028d6d8 100644 --- a/addons/web_graph/static/src/css/graph.css +++ b/addons/web_graph/static/src/css/graph.css @@ -1,5 +1,9 @@ -.graph_main_content { - position: relative; +.graph_pivot_mode { + position:initial; +} + +.graph_chart_mode { + position:relative; } .graph_main_content td { 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(); },