From a43a6c476bb38fa994bb9c718ce33c26ca70413c Mon Sep 17 00:00:00 2001 From: portree_kid Date: Sun, 22 Nov 2020 14:20:03 +0100 Subject: [PATCH] Multiline Edit --- src/renderer/components/ArcEditMulti.vue | 2 +- src/renderer/store/modules/Editable.js | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/ArcEditMulti.vue b/src/renderer/components/ArcEditMulti.vue index fdefe0b..753eafc 100644 --- a/src/renderer/components/ArcEditMulti.vue +++ b/src/renderer/components/ArcEditMulti.vue @@ -84,7 +84,7 @@ You should have received a copy of the GNU General Public License along with FG // getter get: function () { return this.$store.state.Editable.data.multiarc.isPushBackRoute === '1' || - this.$store.state.Editable.data.multiarc.isPushBackRoute === 1 + Number(this.$store.state.Editable.data.multiarc.isPushBackRoute) === Number(1) }, // setter set: function (newValue) { diff --git a/src/renderer/store/modules/Editable.js b/src/renderer/store/modules/Editable.js index b1633fe..45270bf 100644 --- a/src/renderer/store/modules/Editable.js +++ b/src/renderer/store/modules/Editable.js @@ -1,3 +1,15 @@ +/** +Copyright 2020 Keith Paterson + +This file is part of FG Airports. + +FG Airports is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +FG Airports is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with FG Airports. If not, see http://www.gnu.org/licenses/. +*/ + import Vue from 'vue' const state = { @@ -68,13 +80,15 @@ const mutations = { return } if (!state.data || state.type !== 'multiarc') { - Vue.set(state, 'data', {}) + Vue.set(state, 'data', {multiarc: {}}) } - Vue.set(state.data, 'multiarc', arc) + Vue.set(state.data.multiarc, 'isPushBackRoute', arc.isPushBackRoute) + Vue.set(state.data.multiarc, 'direction', arc.direction) if (state.data.multiarc.name === undefined) { Vue.set(state.data.multiarc, 'name', '') } Vue.set(state, 'index', arc.index) + Vue.set(state, 'type', 'multiarc') }, 'SET_EDIT_MULTI_ARC_IDS' (state, arcs) { @@ -84,6 +98,9 @@ const mutations = { if (!state.data || state.type !== 'multiarc') { return } + if (state.data.multiarc.ids === undefined) { + state.data.multiarc.ids = [] + } state.data.multiarc.ids = state.data.multiarc.ids.concat(arcs.filter(n => n).filter((v, i, a) => a.indexOf(v) === i)) }, 'SET_EDIT_PARKING_NAME' (state, parkingName) {