summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2020-05-26 09:45:25 +0000
committerJulien Mougenot <jum@odoo.com>2020-05-26 13:09:00 +0000
commit709d2e8a7a7dbbc959b8a4f6b29a13fee1c07196 (patch)
treed2f3351cf907720fddc72cdfaba430344c3ab2e2 /addons/web/static/src/js
parent22167aac57f46e2e954b1ccce7225af08a150d86 (diff)
[IMP] account,web: SearchPanel: improve folding behaviour
1) Clicks on a section value are now bound to the entire header, meaning that the sole purpose of the carets is purely esthetic. 2) Search panel categories will now only be folded if they are being clicked on while already selected. Classes that were no longer useful have been removed and tests have been updated accordingly. Task 2264700 closes odoo/odoo#51555 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/search_panel.js19
1 files changed, 3 insertions, 16 deletions
diff --git a/addons/web/static/src/js/views/search_panel.js b/addons/web/static/src/js/views/search_panel.js
index eba680627f2..38019fc01cd 100644
--- a/addons/web/static/src/js/views/search_panel.js
+++ b/addons/web/static/src/js/views/search_panel.js
@@ -67,7 +67,6 @@ const SearchPanel = Widget.extend({
className: 'o_search_panel',
events: {
'click .o_search_panel_category_value header': '_onCategoryValueClicked',
- 'click .o_search_panel_category_value .o_toggle_fold_container': '_onToggleFoldCategory',
'change .o_search_panel_filter_value > header > div > input': '_onFilterValueChanged',
'change .o_search_panel_filter_group > header > div > input': '_onFilterGroupChanged',
},
@@ -726,8 +725,9 @@ const SearchPanel = Widget.extend({
item.dataset.id || false;
const hasChanged = category.activeValueId !== valueId;
category.activeValueId = valueId;
- if (category.values[valueId]) {
- category.values[valueId].folded = !category.values[valueId].folded;
+ const value = category.values[category.activeValueId];
+ if (value) {
+ value.folded = value.folded ? false : !hasChanged;
}
if (hasChanged) {
const storageKey = this._getLocalStorageKey(category);
@@ -769,19 +769,6 @@ const SearchPanel = Widget.extend({
}
this._notifyDomainUpdated();
},
- /**
- * @private
- * @param {MouseEvent} ev
- */
- _onToggleFoldCategory(ev) {
- ev.preventDefault();
- ev.stopPropagation();
- const item = ev.currentTarget.closest('.o_search_panel_category_value');
- const category = this.categories[item.dataset.categoryId];
- const valueId = item.dataset.id;
- category.values[valueId].folded = !category.values[valueId].folded;
- this._render();
- },
});
return SearchPanel;