Skip to content
Snippets Groups Projects
Unverified Commit 9b586537 authored by Julien Veyssier's avatar Julien Veyssier
Browse files

fix dashboard statuses sort function

parent ae596362
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
return (status) => !(status in this.enabledStatuses) || this.enabledStatuses[status] return (status) => !(status in this.enabledStatuses) || this.enabledStatuses[status]
}, },
sortedAllStatuses() { sortedAllStatuses() {
return Object.keys(this.allCallbacksStatus).slice().sort((a, b) => a > b) return Object.keys(this.allCallbacksStatus).slice().sort(this.sortStatuses)
}, },
sortedPanels() { sortedPanels() {
return Object.values(this.panels).sort((a, b) => { return Object.values(this.panels).sort((a, b) => {
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
}) })
}, },
sortedRegisteredStatus() { sortedRegisteredStatus() {
return this.registeredStatus.slice().sort((a, b) => a > b) return this.registeredStatus.slice().sort(this.sortStatuses)
}, },
}, },
watch: { watch: {
...@@ -352,6 +352,15 @@ export default { ...@@ -352,6 +352,15 @@ export default {
} }
this.saveStatuses() this.saveStatuses()
}, },
sortStatuses(a, b) {
const al = a.toLowerCase()
const bl = b.toLowerCase()
return al > bl
? 1
: al < bl
? -1
: 0
},
handleScroll() { handleScroll() {
if (window.scrollY > 70) { if (window.scrollY > 70) {
document.body.classList.add('dashboard--scrolled') document.body.classList.add('dashboard--scrolled')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment