wip disable filters strategy is written in comments

This commit is contained in:
lenovo
2022-11-15 22:04:18 +01:00
parent d50f6f6cd8
commit 8738265a56
2 changed files with 18 additions and 2 deletions

View File

@@ -35,6 +35,7 @@
- [/] dans categories, transformer fleches en "autres"
- [/] effacer les fenetres, au moins sur le bouton effacer, ou sur mouvement
- [/] zoom sur cluster problem
- [ ] transform names without space
- [ ] change appearance of filter according to other filters
- [ ] deal with error double event irl and online

View File

@@ -115,6 +115,21 @@ function redraw_clusters(indexes) {
g_marker_cluster.render();
}
/*
should iterate through all dom elements with class "menu_items"
and invert (if exist, suppress, else create) the class construct like this :
disabled_by_menu-name
where menu-name is not the name of the menu that contains the item,
but the name of the menu within wich the click provide. exemple :
- you click on menu-item:"france" in menu:"country"
- it disable menu-item:"conference-table-ronde" in menu:"category"
- by adding class "disabled_by_country"
- and if you click again on menu-item:"france" in menu:"country"
- it will remove class "disabled_by_country"
- if it's the last class containing "disabled_by_" it will be re-enabled
see css attribute selectors : https://www.w3schools.com/css/css_attribute_selectors.asp
*/
function disable_menus(menu) {
console.log("menu:");
console.log(menu);
@@ -142,8 +157,6 @@ function filter_show_only(element, menu_name) {
if (menu_index != "menu_name")
indexes = menu.indexes;
disable_menus(menu);
add = false;
reverse = false;
if (element.type === "checkbox") {
@@ -151,6 +164,8 @@ function filter_show_only(element, menu_name) {
add = true;
}
disable_menus(menu);
let index_array = filter_selection_indexes(menu_name, indexes, reverse, add);
redraw_clusters(index_array);