[FIX] fix various issues with the drawer (addon web)
* separate the css class oe_searchview_custom into oe_searchview_custom and oe_searchview_savefilter to be able to style them independently * by default, the drawer has display:none * fix a bug occuring when the user removed a custom filter (it hid the remaining filters)
This commit is contained in:
@@ -1655,7 +1655,7 @@
|
||||
.openerp .oe_searchview_drawer form button {
|
||||
margin: 0 0 8px -3px;
|
||||
}
|
||||
.openerp .oe_searchview_drawer .oe_searchview_custom form {
|
||||
.openerp .oe_searchview_drawer .oe_searchview_savefilter form {
|
||||
display: none;
|
||||
}
|
||||
.openerp .oe_searchview_drawer .oe_searchview_custom li {
|
||||
|
||||
@@ -1292,6 +1292,7 @@ $sheet-padding: 16px
|
||||
.oe_searchview_drawer_container
|
||||
overflow: auto
|
||||
.oe_searchview_drawer
|
||||
display:none
|
||||
width: 100%
|
||||
cursor: default
|
||||
display: none
|
||||
@@ -1356,9 +1357,10 @@ $sheet-padding: 16px
|
||||
line-height: 18px
|
||||
button
|
||||
margin: 0 0 8px -3px // Managed margin-left according bootstrap3
|
||||
.oe_searchview_custom
|
||||
.oe_searchview_savefilter
|
||||
form
|
||||
display: none
|
||||
.oe_searchview_custom
|
||||
li
|
||||
cursor: pointer
|
||||
position: relative
|
||||
|
||||
@@ -826,10 +826,14 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({
|
||||
},
|
||||
|
||||
start: function() {
|
||||
var self = this;
|
||||
var filters_ready = this.searchview.fields_view_get
|
||||
.then(this.proxy('prepare_filters'));
|
||||
return $.when(this._super(), filters_ready)
|
||||
.then(this.proxy('notify_searchview'));
|
||||
return $.when(this._super(), filters_ready).then(function () {
|
||||
self.$el.show();
|
||||
var defaults = arguments[1][0];
|
||||
self.ready.resolve.apply(null, defaults);
|
||||
});
|
||||
},
|
||||
prepare_filters: function (data) {
|
||||
this.make_widgets(
|
||||
@@ -852,10 +856,6 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({
|
||||
|
||||
return $.when(defaults_fetched, add_custom_reports, add_filters, add_rest);
|
||||
},
|
||||
notify_searchview: function () {
|
||||
var defaults = arguments[1][0];
|
||||
this.ready.resolve.apply(null, defaults);
|
||||
},
|
||||
/**
|
||||
* Sets up thingie where all the mess is put?
|
||||
*/
|
||||
@@ -1807,7 +1807,7 @@ instance.web.search.CustomReports = instance.web.search.Input.extend({
|
||||
$filter.remove();
|
||||
delete self.$filters[key];
|
||||
delete self.filters[key];
|
||||
if (!self.filters.length) {
|
||||
if (!Object.keys(self.filters).length) {
|
||||
self.hide();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1732,7 +1732,7 @@
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div t-name="SearchView.SaveFilter" class="oe_searchview_custom">
|
||||
<div t-name="SearchView.SaveFilter" class="oe_searchview_savefilter">
|
||||
<h4>Save current filter</h4>
|
||||
<form class="oe_form">
|
||||
<p class="oe_form_required"><input id="oe_searchview_custom_input" placeholder="Filter name"/></p>
|
||||
|
||||
Reference in New Issue
Block a user