[FIX]calendar tooltip attachment container

bzr revid: csn@openerp.com-20140423145235-ajph1xj2l492q1sy
This commit is contained in:
Cedric Snauwaert 2014-04-23 16:52:35 +02:00
parent d3ee65eed6
commit 8ddf7a21b7
1 changed files with 13 additions and 5 deletions

View File

@ -1870,11 +1870,19 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi
widget = widget || this;
trigger = trigger || this.$el;
var container = 'body';
//in the case we have a modal currently showing, attach tooltip
//to the modal to prevent the tooltip to show in the body in the
//case we close the modal too fast
if (window.$('.modal.in').length>0){
container = window.$('.modal.in:last()');
/*TODO: need to be refactor
in the case we can find the view form in the parent,
attach the element to it (to prevent tooltip to keep showing
when switching view) or if we have a modal currently showing,
attach tooltip to the modal to prevent the tooltip to show in the body in the
case we close the modal too fast*/
if ($(trigger).parents('.oe_view_manager_view_form').length > 0){
container = $(trigger).parents('.oe_view_manager_view_form');
}
else {
if (window.$('.modal.in').length>0){
container = window.$('.modal.in:last()');
}
}
options = _.extend({
delay: { show: 500, hide: 0 },