This commit is contained in:
Paolo Possanzini
2018-03-27 17:00:03 +02:00
parent a503c3806d
commit cdaa1ad683
@@ -13,7 +13,10 @@
<div class="axes-menu-container" v-if="showAxesMenu">
<div class="menu">
<button @click="setAxes(a.Id)" v-for="a in axes" :key="a.Id">{{a.Name}}</button>
<button @click="setAxes(a.Id)"
v-for="a in axes"
:key="a.Id"
:class="{active: a.Id == selectedAxisId}">{{a.Name}}</button>
</div>
</div>
@@ -37,12 +40,15 @@ export default {
};
},
computed: {
axes: function(){
axes: function() {
return this.$store.state.process.axes;
},
machineInfo: function() {
return this.$store.state.machineInfo;
},
selectedAxisId: function() {
return this.$store.state.process.selectedAxis;
}
},
methods: {
@@ -79,12 +85,11 @@ export default {
this.showAxesMenu = false;
this.showIncrMenu = !this.showIncrMenu;
},
getAxesName(){
getAxesName() {
let id = this.$store.state.process.selectedAxis;
for (const k in this.$store.state.process.axes){
for (const k in this.$store.state.process.axes) {
let a = this.$store.state.process.axes[k];
if(a.Id == id) return a.Name;
if (a.Id == id) return a.Name;
}
return null;
}