WIP Buttons only when not editing
This commit is contained in:
parent
37e97e84e2
commit
9a3f473949
@ -12,7 +12,7 @@
|
||||
trigger="hover"
|
||||
content="Center to airport"
|
||||
>
|
||||
<el-button @click="goto" class="button" slot="reference">
|
||||
<el-button @click="goto" class="button" slot="reference" :disabled="editing">
|
||||
<i class="fas fa-bullseye"></i>
|
||||
</el-button>
|
||||
</el-popover>
|
||||
@ -23,7 +23,7 @@
|
||||
trigger="hover"
|
||||
content="Remove this Work in progress file"
|
||||
>
|
||||
<el-button @click="remove" tooltip="Remove wip file" class="button" slot="reference">
|
||||
<el-button @click="remove" tooltip="Remove wip file" class="button" slot="reference" :disabled="editing">
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
</el-button>
|
||||
</el-popover>
|
||||
@ -34,7 +34,7 @@
|
||||
trigger="hover"
|
||||
content="Upload work in progress"
|
||||
>
|
||||
<el-button @click="upload" tooltip="Upload to groundweb" class="button" slot="reference">
|
||||
<el-button @click="upload" tooltip="Upload to groundweb" class="button" slot="reference" :disabled="editing">
|
||||
<i class="fas fa-upload"></i>
|
||||
</el-button>
|
||||
</el-popover>
|
||||
@ -50,8 +50,9 @@
|
||||
|
||||
export default {
|
||||
name: 'airport',
|
||||
props: {airport: Object},
|
||||
props: {airport: Object, editing: Boolean},
|
||||
mounted () {
|
||||
this.$forceUpdate();
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
@ -154,6 +154,8 @@
|
||||
enableEdit () {
|
||||
this.editable = true
|
||||
this.editing = true
|
||||
this.$store.commit('SET_EDIT', true)
|
||||
|
||||
this.featureLookup = [];
|
||||
this.groundnetLayerGroup.eachLayer(l => {
|
||||
l.enableEdit()
|
||||
@ -170,6 +172,7 @@
|
||||
disableEdit () {
|
||||
this.editable = false
|
||||
this.editing = false
|
||||
this.$store.commit('SET_EDIT', false)
|
||||
this.groundnetLayerGroup.eachLayer(l => {
|
||||
l.disableEdit()
|
||||
})
|
||||
|
@ -22,7 +22,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row v-for="w in wip" :key="w.icao">
|
||||
<Airport :airport="w"></Airport>
|
||||
<Airport :airport="w" :editing="editing"></Airport>
|
||||
</el-row>
|
||||
</div>
|
||||
</section>
|
||||
@ -43,6 +43,11 @@
|
||||
methods: {
|
||||
},
|
||||
computed: {
|
||||
editing: {
|
||||
get: function () {
|
||||
return this.$store.state.Editable.editing
|
||||
}
|
||||
},
|
||||
wip: function () {
|
||||
return this.$store.state.Settings.wip
|
||||
}
|
||||
|
@ -13,6 +13,9 @@ const SET_EDIT_ARC = 'SET_EDIT_ARC'
|
||||
const SET_EDIT_RUNWAY = 'SET_EDIT_RUNWAY'
|
||||
|
||||
const mutations = {
|
||||
SET_EDIT (state, editing) {
|
||||
state.editing = editing
|
||||
},
|
||||
SET_EDIT_AIRPORT (state, airport) {
|
||||
Vue.set(state.data, 'airport', airport)
|
||||
state.index = airport.icao
|
||||
|
Loading…
Reference in New Issue
Block a user