Save Dialog / Bugfixes

This commit is contained in:
portree_kid 2020-02-27 19:31:23 +01:00
parent e1bf234cbb
commit 6fe95be8f7
4 changed files with 24 additions and 8 deletions

View File

@ -9,6 +9,9 @@
<el-button type="primary" @click="undoLast">Last save</el-button>
</span>
</el-dialog>
<el-dialog title="Saving" :visible.sync="saveDialogVisible" width="30%" center>
<span style="center">Saving..</span>
</el-dialog>
<EditButton icon="fas fa-save" v-on:click="save" :show="editing" tooltip="Save"></EditButton>
<EditButton icon="fas fa-draw-polygon" v-on:click="drawPolyline" :show="editing" tooltip="Draw Taxiline"></EditButton>
@ -18,11 +21,13 @@
</template>
<script lang="js">
/* eslint-disable */
import EditButton from './EditButton'
import Vue from 'vue'
export default {
components: { EditButton },
data () {
return {isEditing: false, centerDialogVisible: false}
return {isEditing: false, centerDialogVisible: false, saveDialogVisible: false}
},
created () {
},
@ -45,8 +50,13 @@
},
save () {
this.editing = false
this.$parent.$parent.$refs.editLayer.save()
this.$parent.$parent.$refs.editLayer.disableEdit()
Vue.set(this, 'saveDialogVisible', true)
this.editing = false
Vue.nextTick( () => {
this.$parent.$parent.$refs.editLayer.save()
this.$parent.$parent.$refs.editLayer.disableEdit()
Vue.set(this, 'saveDialogVisible', false)
}, this)
},
drawPolyline () {
this.$parent.$parent.$refs.editLayer.drawPolyline()

View File

@ -237,7 +237,7 @@
editedArc() {
console.log('Edited Arc : ' + this.$store.state.Editable.index);
var arc = this.groundnetLayerGroup.getLayer(this.$store.state.Editable.index);
if (arc) {
if (arc && arc instanceof L.Polyline) {
arc.options.attributes = Object.assign({}, this.$store.state.Editable.data.arc)
arc.updateStyle();
}

View File

@ -39,7 +39,9 @@
this.groundnet.addTo(this.$parent.mapObject)
}
this.groundnet.eachLayer(l => {
l.bringToBack()
if (l) {
l.bringToBack()
}
})
},
visible (feature) {

View File

@ -55,9 +55,13 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
},
() => {
// Reset colour
event.target.options.attributes.selected = false;
event.target.updateStyle();
this.unwatch();
if(event.target instanceof L.Polyline &&
event.target.options.attributes &&
event.target.options.attributes.selected) {
event.target.options.attributes.selected = false;
event.target.updateStyle();
this.unwatch();
}
}
,
{