[imp] small improvements to advanced filters

bzr revid: nicolas.vanhoren@openerp.com-20110621130501-0f1rkr25vv86v8gq
This commit is contained in:
niv-openerp 2011-06-21 15:05:01 +02:00
parent 4e9834f4e3
commit 3cb34f3f85
2 changed files with 18 additions and 1 deletions

View File

@ -547,11 +547,15 @@ background: linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,
}
.openerp .searchview_extended_group {
border: #696969 solid 1px;
border-bottom: #696969 solid 1px;
padding: 3px;
margin: 2px;
}
.openerp .searchview_extended_group.last_group {
border-bottom: none;
}
.openerp .oe_search-view-custom-filter-btn span {
background: url(../img/icons/gtk-add.png) repeat-y;
padding-left: 18px;

View File

@ -731,6 +731,7 @@ openerp.base.search.ExtendedSearch = openerp.base.BaseWidget.extend({
var render = group.render();
this.$element.find('.searchview_extended_groups_list').append(render);
group.start();
this.check_last_element();
},
start: function () {
this._super();
@ -771,6 +772,10 @@ openerp.base.search.ExtendedSearch = openerp.base.BaseWidget.extend({
if(this.$element.hasClass("expanded")) {
this.$element.toggleClass("folded expanded");
}
},
check_last_element: function() {
_.each(this.children, function(x) {x.set_last_group(false);});
this.children[this.children.length - 1].set_last_group(true);
}
});
@ -810,9 +815,17 @@ openerp.base.search.ExtendedSearchGroup = openerp.base.BaseWidget.extend({
props);
},
stop: function() {
var parent = this.parent;
if (this.parent.children.length == 1)
this.parent.hide();
this._super();
parent.check_last_element();
},
set_last_group: function(is_last) {
if(is_last)
this.$element.addClass("last_group");
else
this.$element.removeClass("last_group");
}
});