[imp] improved menu disapearance

bzr revid: nicolas.vanhoren@openerp.com-20111207112214-hvff0rtfl12jk355
This commit is contained in:
niv-openerp
2011-12-07 12:22:14 +01:00
parent ec123c78db
commit 21c1918717
2 changed files with 11 additions and 2 deletions
+6 -2
View File
@@ -837,7 +837,8 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
init: function(parent, element_id, secondary_menu_id) {
this._super(parent, element_id);
this.secondary_menu_id = secondary_menu_id;
this.$secondary_menu = $("#" + secondary_menu_id).hide();
this.$secondary_menu = $("#" + secondary_menu_id);
this.$secondary_menu.hide();
this.menu = false;
this.folded = false;
if (window.localStorage) {
@@ -911,7 +912,10 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
sub_menu_visible = $sub_menu.is(':visible');
this.$secondary_menu.find('.oe_secondary_menu').hide();
$('.active', this.$element.add(this.$secondary_menu.show())).removeClass('active');
if (this.$secondary_menu.hasClass('oe_folded')) {
this.$secondary_menu.show();
}
$('.active', this.$element.add(this.$secondary_menu)).removeClass('active');
$main_menu.add($clicked_menu).add($sub_menu).addClass('active');
if (!(this.folded && manual)) {
@@ -376,8 +376,13 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({
template: 'ApplicationTiles',
start: function () {
this._super();
$('.secondary_menu', this.$element.closest('.openerp')).hide();
return this.do_display_root_menu();
},
stop: function () {
$('.secondary_menu', this.$element.closest('.openerp')).show();
this._super();
},
do_display_root_menu: function() {
var self = this;
return new openerp.web.DataSetSearch( this, 'ir.ui.menu', null, [['parent_id', '=', false]])