[FIX] web_kanban: display kanban tooltip

Fixes opw-687563
This commit is contained in:
Christophe Matthieu
2016-11-04 16:34:20 +01:00
committed by Géry Debongnie
parent a8e79e960a
commit 5f16a6f8ab
2 changed files with 15 additions and 3 deletions
@@ -156,7 +156,6 @@
<t t-name="kanban-tooltip">
<ul class="oe_kanban_tooltip">
<li><b>Project:</b> <field name="project_id"/></li>
<li><b>Category:</b> <field name="tag_ids"/></li>
</ul>
</t>
<t t-name="kanban-box">
@@ -64,6 +64,7 @@ var KanbanRecord = Widget.extend({
qweb_context[p] = _.bind(this[p], this);
}
}
this.qweb_context = qweb_context;
this.content = this.qweb.render('kanban-box', qweb_context);
},
@@ -81,7 +82,18 @@ var KanbanRecord = Widget.extend({
},
start: function() {
var self = this;
this.add_widgets();
this.$('[tooltip]').each(function () {
var $el = $(this);
var tooltip = $el.attr('tooltip');
if (tooltip) {
$el.tooltip({
'html': true,
'title': self.qweb.render(tooltip, self.qweb_context)
});
}
});
},
renderElement: function () {
@@ -172,14 +184,15 @@ var KanbanRecord = Widget.extend({
if (elem == ev.currentTarget) {
ischild = false;
}
var test_event = events && events.click && (events.click.length > 1 || events.click[0].namespace !== "tooltip");
if (ischild) {
children.push(elem);
if (events && events.click) {
if (test_event) {
// do not trigger global click if one child has a click event registered
trigger = false;
}
}
if (trigger && events && events.click) {
if (trigger && test_event) {
_.each(events.click, function(click_event) {
if (click_event.selector) {
// For each parent of original target, check if a