Merge pull request #1852 from nextcloud/sortLabels

This commit is contained in:
Julius Härtl
2020-05-14 10:40:12 +02:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -224,6 +224,9 @@ export default {
}
return 'opacity: .5;'
},
labelsSorted() {
return [...this.board.labels].sort((a, b) => (a.title < b.title) ? -1 : 1)
},
},
methods: {
beforeSetFilter(e) {

View File

@@ -1,7 +1,7 @@
<template>
<div>
<ul class="labels">
<li v-for="label in labels" :key="label.id" :class="{editing: (editingLabelId === label.id)}">
<li v-for="label in labelsSorted" :key="label.id" :class="{editing: (editingLabelId === label.id)}">
<!-- Edit Tag -->
<template v-if="editingLabelId === label.id">
<form class="label-form" @submit.prevent="updateLabel(label)">
@@ -111,6 +111,9 @@ export default {
return true
},
labelsSorted() {
return [...this.labels].sort((a, b) => (a.title < b.title) ? -1 : 1)
},
},
methods: {