[FIX]tooltip on kanban should be bind to element itself instead of body to prevent tooltip to stay visible

bzr revid: csn@openerp.com-20140423073840-m85t30lwgt8uf465
This commit is contained in:
Cedric Snauwaert 2014-04-23 09:38:40 +02:00
parent 058427d88b
commit 7c02150c97
1 changed files with 16 additions and 9 deletions

View File

@ -925,15 +925,22 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
bind_events: function() {
var self = this;
this.setup_color_picker();
this.$el.find('[title]').tooltip({
delay: { show: 500, hide: 0},
title: function() {
var template = $(this).attr('tooltip');
if (!self.view.qweb.has_template(template)) {
return false;
}
return self.view.qweb.render(template, self.qweb_context);
},
this.$el.find('[title]').each(function(){
//in case of kanban, attach tooltip to the element itself
//otherwise it might stay on screen when kanban view reload
//since default container is body.
//(when clicking on ready for next stage for example)
$(this).tooltip({
delay: { show: 500, hide: 0},
container: $(this),
title: function() {
var template = $(this).attr('tooltip');
if (!self.view.qweb.has_template(template)) {
return false;
}
return self.view.qweb.render(template, self.qweb_context);
},
});
});
// If no draghandle is found, make the whole card as draghandle (provided one can edit)