From bad59e34054220e1cfd1abbd13e04f9bca05d850 Mon Sep 17 00:00:00 2001 From: portree_kid Date: Thu, 27 Feb 2020 20:45:46 +0100 Subject: [PATCH] Search back to normal --- src/renderer/components/Search.vue | 2 +- src/renderer/loaders/ParkingSpot.js | 9 +++++++-- src/renderer/store/modules/Airports.js | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/Search.vue b/src/renderer/components/Search.vue index 6c0b527..728a10c 100644 --- a/src/renderer/components/Search.vue +++ b/src/renderer/components/Search.vue @@ -128,7 +128,7 @@ searched: function () { console.log(this.searchterm) let searchRegex = new RegExp(this.searchterm, 'i') - return this.$store.state.Airports.unfilteredairports + return this.$store.state.Airports.airports .filter(a => searchRegex.test(a.properties.icao) || searchRegex.test(a.properties.name)) // .map(a => console.log(a.properties)) .map(a => ({ icao: a.properties.icao, name: a.properties.name })) diff --git a/src/renderer/loaders/ParkingSpot.js b/src/renderer/loaders/ParkingSpot.js index df62318..8d972d5 100644 --- a/src/renderer/loaders/ParkingSpot.js +++ b/src/renderer/loaders/ParkingSpot.js @@ -118,8 +118,10 @@ L.ParkingSpot = L.Circle.extend({ return state.Editable.data.parking; }, () => { - event.target.updateStyle(); - this.unwatch(); + if (event.target instanceof L.ParkingSpot) { + event.target.setStyle({color : '#3388ff'}); + this.unwatch(); + } } , { @@ -153,6 +155,9 @@ L.ParkingSpot = L.Circle.extend({ this.on('editable:disable', function (event) { event.target.removeDirection(); }); + }, + updateStyle: function () { + }, turfToLatLng: function (turfPoint) { return {lat: turfPoint.geometry.coordinates[1], lng: turfPoint.geometry.coordinates[0]}; diff --git a/src/renderer/store/modules/Airports.js b/src/renderer/store/modules/Airports.js index 531e836..dbb5858 100644 --- a/src/renderer/store/modules/Airports.js +++ b/src/renderer/store/modules/Airports.js @@ -1,5 +1,6 @@ /* eslint-disable */ import idb from '../api/airports'; +import Vue from 'vue'; const ADD_AIRPORT = 'ADD_AIRPORT'; const SET_AIRPORTS = 'SET_AIRPORTS'; @@ -16,7 +17,7 @@ const mutations = { state.airports.push(airports); }, SET_AIRPORTS (state, airports) { - state.airports = airports; + Vue.set(state, 'airports', airports); }, SET_UNFILTERED_AIRPORTS (state, airports) { state.unfilteredairports = airports;