diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-04-22 17:03:16 +0200 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-04-22 17:03:16 +0200 |
| commit | f584b030bc869277f8ae2573e125b347d579364c (patch) | |
| tree | cd189845f199dc50b130a696e8a42757d1b80217 /addons/web_graph/static/src/js/graph_widget.js | |
| parent | 8c001acda0726042f52f30b37a5f7b266d069c5f (diff) | |
[FIX] correct fix for the scrolling problem in graph view: the view now saves its scrolling position before redrawing itself (addon web_graph)
bzr revid: ged@openerp.com-20140422150316-m51u750732re8qib
Diffstat (limited to 'addons/web_graph/static/src/js/graph_widget.js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph_widget.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index 1cac1051ec7..3d3c8b77513 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -26,8 +26,6 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ this.graph_view = options.graph_view || null; this.pivot_options = options; this.title = options.title || 'Data'; - - this.scroll = 0; }, start: function() { @@ -356,7 +354,6 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ groupby = groupby || header.root.groupby[header.path.length]; this.pivot.expand(header_id, groupby).then(function () { - self.scroll = $(window).scrollTop(); if (update_groupby && self.graph_view) { self.graph_view.register_groupby(self.pivot.rows.groupby, self.pivot.cols.groupby); } @@ -501,6 +498,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ // Main display method // ---------------------------------------------------------------------- display_data: function () { + var scroll = $(window).scrollTop(); this.$('.graph_main_content svg').remove(); this.$('.graph_main_content div').remove(); this.table.empty(); @@ -515,7 +513,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ } else { if (this.mode === 'pivot') { this.draw_table(); - $(window).scrollTop(this.scroll); + $(window).scrollTop(scroll); } else { this.$('.graph_main_content').append($('<div><svg>')); this.svg = this.$('.graph_main_content svg')[0]; |
