[IMP] Hide Sidebar section when item list is empty

bzr revid: fme@openerp.com-20120607144935-csiijcfoir2z362o
This commit is contained in:
Fabien Meghazi 2012-06-07 16:49:35 +02:00
parent a6a4f8e752
commit 55bbd5f290
1 changed files with 5 additions and 0 deletions

View File

@ -743,6 +743,11 @@ instance.web.Sidebar = instance.web.Widget.extend({
var self = this;
self.$element.html(QWeb.render('Sidebar', {widget: self}));
this.$element.find('ul').hide();
// Hides Sidebar sections when item list is empty
this.$('.oe_form_dropdown_section').each(function() {
$(this).toggle(!!$(this).find('li').length);
});
},
/**
* For each item added to the section: