[IMP]Improved code for set tooltip placement on top or bottom on the basis of display area.
bzr revid: kch@tinyerp.com-20131217093546-49lg5i0rm1kx9oli
This commit is contained in:
@@ -3464,11 +3464,11 @@ div.ui-widget-overlay {
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
text-align: left;
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.tooltip.bottom .tooltip-arrow {
|
||||
left: 35%;
|
||||
left: 35% !important;
|
||||
}
|
||||
|
||||
button, body {
|
||||
|
||||
@@ -2767,9 +2767,9 @@ div.ui-widget-overlay
|
||||
|
||||
// Customize bootstrap3 for tooltip
|
||||
.tooltip-inner
|
||||
text-align: left
|
||||
text-align: left !important
|
||||
.tooltip.bottom .tooltip-arrow
|
||||
left: 35%
|
||||
left: 35% !important
|
||||
// End of customize
|
||||
|
||||
// Customize for global tags
|
||||
|
||||
@@ -401,7 +401,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
||||
.on('add change reset remove', this.proxy('do_search'))
|
||||
.on('add change reset remove', this.proxy('renderFacets'));
|
||||
$('.oe_searchview_unfold_drawer').attr('data-toggle', 'tooltip');
|
||||
$('.oe_searchview_unfold_drawer').tooltip({html: true});
|
||||
$('.oe_searchview_unfold_drawer').tooltip({placement: 'bottom', html: true});
|
||||
if (this.options.hidden) {
|
||||
this.$el.hide();
|
||||
}
|
||||
|
||||
@@ -1862,7 +1862,12 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi
|
||||
});
|
||||
},
|
||||
container: 'body',
|
||||
placement: 'bottom',
|
||||
placement: function(tip, trigger) { //dynamic set position
|
||||
var offset = $(trigger).offset();
|
||||
var vert = 0.5 * $(document).outerHeight() - offset.top;
|
||||
var vertPlacement = vert > 0 ? 'bottom' : 'top';
|
||||
return vertPlacement;
|
||||
},
|
||||
html: true,
|
||||
opacity: 0.85,
|
||||
}, options || {});
|
||||
|
||||
Reference in New Issue
Block a user