From ab1411aa9eaedc8ef569aaa660cf7a3584f3ef30 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Fri, 15 Nov 2013 13:13:15 +0100 Subject: [PATCH] [IMP] makes the text clickable in clickable cells in pivottable (addon web_graph) bzr revid: ged@openerp.com-20131115121315-2lb0mptvv44g8xjk --- addons/web_graph/static/src/css/graph.css | 4 ++++ addons/web_graph/static/src/js/graph.js | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/addons/web_graph/static/src/css/graph.css b/addons/web_graph/static/src/css/graph.css index f2d3338c385..6651ea39ae2 100644 --- a/addons/web_graph/static/src/css/graph.css +++ b/addons/web_graph/static/src/css/graph.css @@ -17,4 +17,8 @@ span.field-selection { span.web_graph_indent { padding-left: 50px; +} + +.web_graph_click:hover { + cursor: pointer; } \ No newline at end of file diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 5a4ff51f2d4..9f94f5eb0ee 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -144,7 +144,6 @@ var BasicDataView = instance.web.Widget.extend({ // measure: quantity to display. either a field from the model, or // null, in which case we use the "count" measure init: function (model, options) { - console.log("initializing", model, options); var self = this; this.model = model; this.fields = options.fields; @@ -218,7 +217,7 @@ var PivotTable = BasicDataView.extend({ current_row_id : 0, events: { - 'click .graph_border > a' : function (event) { + 'click .web_graph_click' : function (event) { var self = this; event.preventDefault(); var row_id = event.target.attributes['data-row-id'].nodeValue; @@ -241,6 +240,9 @@ var PivotTable = BasicDataView.extend({ }; this.dropdown = $(QWeb.render('field_selection', dropdown_options)); $(event.target).after(this.dropdown); + this.dropdown.css({position:"absolute", + left:event.pageX, + top:event.pageY}); $('.field-selection').next('.dropdown-menu').toggle(); } } @@ -292,9 +294,18 @@ var PivotTable = BasicDataView.extend({ }); } if (options && options.foldable) { - attrs.push(' '); + attrs.push(''); } - return attrs.join(' ') + content + ''; + if (content) { + attrs.push(content); + } else { + attrs.push('Undefined'); + } + if (options && options.foldable) { + attrs.push(''); + } + attrs.push(''); + return attrs.join(' '); }, make_row: function (data, parent_id) {