From 597eabdff2c873ac837f9a0da2c2caf92abb2f52 Mon Sep 17 00:00:00 2001 From: Alessandro Francia Date: Thu, 19 Jul 2018 09:00:43 +0200 Subject: [PATCH] order softkey prefered --- Step/wwwroot/src/components/production.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Step/wwwroot/src/components/production.vue b/Step/wwwroot/src/components/production.vue index 6b5b6a47..6e90fa16 100644 --- a/Step/wwwroot/src/components/production.vue +++ b/Step/wwwroot/src/components/production.vue @@ -142,7 +142,20 @@ export default { return this.$store.state.machineInfo.heads; }, softkeyFavorite: function(){ - return this.$store.state.machineInfo.softkeysFavorites; + + function compare(a,b){ + if(a.id < b.id){ + return -1; + } + if(a.id > b.id){ + return 1; + } + return 0; + } + + var array = this.$store.state.machineInfo.softkeysFavorites; + + return array.sort(compare); } }, watch: