[IMP] Changed custom filters displaying.

bzr revid: nicolas.vanhoren@openerp.com-20110520100109-xn5wh6s991fuiagr
This commit is contained in:
niv-openerp 2011-05-20 12:01:09 +02:00
parent a15401a722
commit aea59bce25
3 changed files with 22 additions and 1 deletions

View File

@ -447,6 +447,10 @@ body.openerp {
padding-left: 18px;
}
.openerp .searchview_extended_delete_group {
float:right;
}
.openerp .searchview_extended_delete_group span, .openerp .searchview_extended_delete_prop span {
background: url(../img/icons/gtk-remove.png) repeat-y;
padding-left: 18px;

View File

@ -125,6 +125,7 @@ openerp.base.SearchView = openerp.base.Controller.extend({
// the non-commented line does. As far as we investigated, only God knows.
//this.$element.html(render);
jQuery(render).appendTo(this.$element);
this.$element.find(".oe_search-view-custom-filter-btn").click(ext.on_activate);
var f = this.$element.find('form');
this.$element.find('form')
@ -711,6 +712,7 @@ openerp.base.search.ExtendedSearch = openerp.base.BaseWidget.extend({
},
start: function () {
this._super();
this.$element.closest("table.oe-searchview-render-line").css("display", "none");
var self = this;
this.rpc("/base/searchview/fields_get",
{"model": this.model}, function(data) {
@ -726,11 +728,25 @@ openerp.base.search.ExtendedSearch = openerp.base.BaseWidget.extend({
return null;
},
get_domain: function() {
if(this.$element.hasClass("folded")) {
if(this.$element.closest("table.oe-searchview-render-line").css("display") == "none") {
return null;
}
return _.reduce(this.children,
function(mem, x) { return mem.concat(x.get_domain());}, []);
},
on_activate: function() {
var table = this.$element.closest("table.oe-searchview-render-line");
if (table.css("display") == "none") {
table.css("display", "");
if(this.$element.hasClass("folded")) {
this.$element.toggleClass("folded expanded");
}
} else {
table.css("display", "none");
if(this.$element.hasClass("expanded")) {
this.$element.toggleClass("folded expanded");
}
}
}
});

View File

@ -430,6 +430,7 @@
<div class="oe_search-view-buttons" style="text-align: right;">
<input type="submit" value="Search"/>
<input type="reset" value="Clear"/>
<button class="oe_search-view-custom-filter-btn">Custom Filter</button>
</div>
</form>
</t>