Bhumi Thakkar (Open ERP) has proposed merging
lp:~openerp-dev/openerp-web/trunk-bug-890619-bth into lp:openerp-web.
Requested reviews:
OpenERP R&D Web Team (openerp-dev-web)
Related bugs:
Bug #890619 in OpenERP Web: "strange menu behaviour if left menu is closed"
https://bugs.launchpad.net/openerp-web/+bug/890619
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-890619-bth/+merge/85628
Hello,
fetch the height of sub menu div and stored into one variable and also stored
parent menu name of sub menu. next time when click on menu compared height of
sub menu div with previous height of sub menu div for the same parent menu. If
height is smaller then previous stored height then stored do not change value
of variable and if it is not less than change value of variable.
On mouse leave event, If height of previous sub menu which is stored into
variable is less than height of current clicked sub menu div, then hide the sub
menu div else not hide.
Thanks,
Bhumi
--
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-890619-bth/+merge/85628
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/trunk-bug-890619-bth.
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js 2011-12-14 10:43:01 +0000
+++ addons/web/static/src/js/chrome.js 2011-12-14 10:43:24 +0000
@@ -906,6 +906,20 @@
} else {
$sub_menu = this.$secondary_menu.find('.oe_secondary_menu[data-menu-parent=' + $clicked_menu.attr('data-menu') + ']');
$main_menu = $clicked_menu;
+ if (this.prevheight && this.prevmenu) {
+ if (this.prevmenu.data('menu') == $main_menu.data('menu')) {
+ if (this.prevheight > $sub_menu.height()) {
+ this.prevheight = this.prevheight;
+ } else {
+ this.prevheight = $sub_menu.height();
+ }
+ }else{
+ this.prevheight = $sub_menu.height();
+ }
+ }else{
+ this.prevheight = $sub_menu.height();
+ this.prevmenu = $main_menu;
+ }
}
sub_menu_visible = $sub_menu.is(':visible');
@@ -927,6 +941,7 @@
$(this).removeClass('opened').next().hide();
}
});
+ $clicked_menu.next().find('a.leaf').focus();
$clicked_menu.toggleClass('opened').next().toggle();
} else if ($clicked_menu.is('.leaf')) {
$sub_menu.toggle(!this.folded);
@@ -966,10 +981,12 @@
$sub_menu.css(css);
$sub_menu.mouseenter(function() {
clearTimeout($sub_menu.data('timeoutId'));
- }).mouseleave(function(evt) {
+ }).mouseleave(function() {
var timeoutId = setTimeout(function() {
if (self.folded) {
- $sub_menu.hide();
+ if (self.prevheight < $sub_menu.height()) {
+ $sub_menu.hide();
+ }
}
}, self.float_timeout);
$sub_menu.data('timeoutId', timeoutId);
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp