Browse Source

[FIX] advanced filters not visible when switching views

pull/29/head
Holger Brunn 10 years ago
parent
commit
6ff2b14f15
  1. 41
      advanced_filters/static/src/js/advanced_filters.js

41
advanced_filters/static/src/js/advanced_filters.js

@ -39,24 +39,7 @@ openerp.advanced_filters = function(instance)
do_select: function (ids, records) do_select: function (ids, records)
{ {
var result = this._super(this, arguments); var result = this._super(this, arguments);
if(this.sidebar)
{
this.sidebar.$el.show();
this.sidebar.$el.children().children().each(function(i, e)
{
$e = jQuery(e)
if($e.find('li.oe_advanced_filters_header').length)
{
$e.find('a[data-index="3"],a[data-index="4"],' +
'a[data-index="5"],a[data-index="6"]')
.parent().toggle(ids.length > 0);
}
else
{
$e.toggle(ids.length > 0);
}
});
}
this.advanced_filters_show(ids);
return result; return result;
}, },
load_list: function(data) load_list: function(data)
@ -65,6 +48,7 @@ openerp.advanced_filters = function(instance)
self = this; self = this;
if(!this.sidebar || this.sidebar.items.advanced_filters.length) if(!this.sidebar || this.sidebar.items.advanced_filters.length)
{ {
this.advanced_filters_show([]);
return result; return result;
} }
this.sidebar.add_items( this.sidebar.add_items(
@ -123,6 +107,27 @@ openerp.advanced_filters = function(instance)
this.do_select([], []); this.do_select([], []);
return result; return result;
}, },
advanced_filters_show: function(ids)
{
if(this.sidebar)
{
this.sidebar.$el.show();
this.sidebar.$el.children().children().each(function(i, e)
{
$e = jQuery(e)
if($e.find('li.oe_advanced_filters_header').length)
{
$e.find('a[data-index="3"],a[data-index="4"],' +
'a[data-index="5"],a[data-index="6"]')
.parent().toggle(ids.length > 0);
}
else
{
$e.toggle(ids.length > 0);
}
});
}
},
advanced_filters_save_selection: function(item) advanced_filters_save_selection: function(item)
{ {
var self = this; var self = this;

Loading…
Cancel
Save