From 8396a03759741dfd6b10f7f5b339df8524cb80c6 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Sun, 24 Nov 2013 23:03:10 +0100 Subject: [PATCH] [IMP] removes a cell when it has been folded (addon web_graph) bzr revid: ged@openerp.com-20131124220310-4o1okd02cotbqppq --- addons/web_graph/static/src/js/pivot.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/web_graph/static/src/js/pivot.js b/addons/web_graph/static/src/js/pivot.js index f8c71e14975..e310a7799f6 100644 --- a/addons/web_graph/static/src/js/pivot.js +++ b/addons/web_graph/static/src/js/pivot.js @@ -103,12 +103,17 @@ var PivotTable = openerp.web.Class.extend({ _.each(tree.children, tree_traversal); } tree_traversal(header); + var ids_to_remove = _.map(_.rest(list), function (h) { return h.id;}); + header.root.headers = _.difference(header.root.headers, _.rest(list)); header.is_expanded = false; var fold_lvls = _.map(header.root.headers, function(g) {return g.path.length;}); var new_groupby_length = _.max(fold_lvls); header.root.groupby.splice(new_groupby_length); header.children = []; + this.cells = _.reject(this.cells, function (cell) { + return (_.contains(ids_to_remove, cell.x) || _.contains(ids_to_remove, cell.y)); + }); }, expand: function (row_id, field_id) {