diff --git a/src/assets/icon-historyczna.svg b/src/assets/icon-historyczna.svg index aed6e11..4bece83 100644 --- a/src/assets/icon-historyczna.svg +++ b/src/assets/icon-historyczna.svg @@ -1,18 +1,20 @@ - + diff --git a/src/components/StationsView/FilterOption.vue b/src/components/StationsView/FilterOption.vue index ce66ff5..fe175fc 100644 --- a/src/components/StationsView/FilterOption.vue +++ b/src/components/StationsView/FilterOption.vue @@ -1,5 +1,11 @@ - @@ -29,20 +35,51 @@ export default defineComponent({ filterStore: useStationFiltersStore(), }; }, + methods: { - handleChange() { + handleLeftClick() { this.option.value = !this.option.value; + this.filterStore.lastClickedFilterId = ''; this.filterStore.changeFilterValue({ name: this.option.name, value: !this.option.value, }); }, + + handleDbClick(e: Event) { + e.preventDefault(); + + + const lastClicked = this.filterStore.lastClickedFilterId == this.option.id; + console.log(this.filterStore.lastClickedFilterId); + this.filterStore.lastClickedFilterId = this.option.id; + this.option.value = true; + + this.filterStore.changeFilterValue({ + name: this.option.name, + value: !this.option.value, + }); + + this.filterStore.inputs.options + .filter((option) => { + return option.section == this.option.section && option.id != this.option.id; + }) + .forEach((option) => { + this.filterStore.changeFilterValue({ + name: option.name, + value: this.option.value, + }); + + option.value = !this.option.value; + }); + }, }, }); + diff --git a/src/components/StationsView/StationFilterCard.vue b/src/components/StationsView/StationFilterCard.vue index 65e397f..20878fb 100644 --- a/src/components/StationsView/StationFilterCard.vue +++ b/src/components/StationsView/StationFilterCard.vue @@ -26,15 +26,28 @@