diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-11-15 13:13:15 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-11-15 13:13:15 +0100 |
| commit | ab1411aa9eaedc8ef569aaa660cf7a3584f3ef30 (patch) | |
| tree | 35875a9c3c861ecc7e82c84303fa9df15ceee632 /addons/web_graph/static/src/js | |
| parent | 776a57ef0cda65ce03f60d9f5bf3d466225dd4b2 (diff) | |
[IMP] makes the text clickable in clickable cells in pivottable (addon web_graph)
bzr revid: ged@openerp.com-20131115121315-2lb0mptvv44g8xjk
Diffstat (limited to 'addons/web_graph/static/src/js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 19 |
1 files changed, 15 insertions, 4 deletions
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('<a data-row-id="'+ options.row_id + '" href="#" class="icon-plus-sign"> </a>'); + attrs.push('<span data-row-id="'+ options.row_id + '" href="#" class="icon-plus-sign web_graph_click">'); } - return attrs.join(' ') + content + '</td>'; + if (content) { + attrs.push(content); + } else { + attrs.push('Undefined'); + } + if (options && options.foldable) { + attrs.push('</span>'); + } + attrs.push('</td>'); + return attrs.join(' '); }, make_row: function (data, parent_id) { |
