fix in filters if send empty index array it reset this menu

+ fix in filters if click reset it really reset to init
+ made buttons be inputs
This commit is contained in:
lenovo
2022-11-14 02:45:12 +01:00
parent 38beda1e80
commit 0af8822a7f
6 changed files with 76 additions and 30 deletions

View File

@@ -21,8 +21,12 @@ function array_first_not_in_second(first, second) {
function filter_selection_indexes(menu, indexes, reverse, add) {
if (indexes.length === 0) {
// if array of index is empty, delete menu
delete g_indexes[menu];
}
else if (reverse) {
// if reverse is true, delete all indexes in g_indexes.menu
if (reverse) {
// https://stackoverflow.com/questions/5113374/javascript-check-if-variable-exists-is-defined-initialized
if ( typeof(g_indexes[menu]) !== "undefined" && g_indexes[menu] !== null ) {
// creates an array with all values of g_indexes[menu] minus indexes
@@ -141,6 +145,7 @@ function filter_show_only_selection(element, indexes, menu, add = false, zoom_in
function filter_show_all() {
g_indexes = {};
g_marker_cluster.clearMarkers(true);
g_marker_cluster.addMarkers(g_markers);
//g_map.fitBounds(g_init_bounds);
g_map.setCenter(coordinates_default);

View File

@@ -14,7 +14,7 @@ function attach_info_window(map, marker, events, infowindow) {
presence = "en presentiel";
window_content += `
<a href="${events[key].url}" target="_blank" rel="noopener noreferrer">
<a href="${events[key].url}">
<p>${events[key].title}</p>
</a>
`;