[IMP] Improved float submenu positioning

bzr revid: fme@openerp.com-20110919211045-6kqn99p5d8lece6t
This commit is contained in:
Fabien Meghazi 2011-09-19 23:10:45 +02:00
parent e68ec76b0d
commit a195b6912b
2 changed files with 10 additions and 2 deletions

View File

@ -806,8 +806,16 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
},
do_show_secondary: function($sub_menu, $main_menu) {
if (this.folded) {
var css = $main_menu.position();
var css = $main_menu.position(),
fold_width = this.$secondary_menu.width() + 2,
window_width = $(window).width();
css.top += 33;
css.left -= Math.round(($sub_menu.width() - $main_menu.width()) / 2);
css.left = css.left < fold_width ? fold_width : css.left;
if ((css.left + $sub_menu.width()) > window_width) {
delete(css.left);
css.right = 1;
}
$sub_menu.css(css);
}
$sub_menu.show();

View File

@ -39,7 +39,7 @@
</tr>
<tr>
<td colspan="2" valign="top" height="100%">
<table cellspacing="0" cellpadding="0" border="0" height="100%">
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
<tr>
<td valign="top" id="oe_secondary_menu" class="secondary_menu">
</td>