forked from platypush/platypush
[UI Nav] Ensure that entities
and execute
tabs are always on top.
This commit is contained in:
parent
6d53a3f80f
commit
3cfd72b649
1 changed files with 10 additions and 3 deletions
|
@ -93,10 +93,17 @@ export default {
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
panelNames() {
|
panelNames() {
|
||||||
|
const prepend = (names, name) => {
|
||||||
|
const idx = panelNames.indexOf(name)
|
||||||
|
if (idx >= 0)
|
||||||
|
names = [name].concat((names.slice(0, idx).concat(names.slice(idx+1))))
|
||||||
|
|
||||||
|
return names
|
||||||
|
}
|
||||||
|
|
||||||
let panelNames = Object.keys(this.panels)
|
let panelNames = Object.keys(this.panels)
|
||||||
const homeIdx = panelNames.indexOf('entities')
|
panelNames = prepend(panelNames, 'execute')
|
||||||
if (homeIdx >= 0)
|
panelNames = prepend(panelNames, 'entities')
|
||||||
return ['entities'].concat((panelNames.slice(0, homeIdx).concat(panelNames.slice(homeIdx+1))).sort())
|
|
||||||
return panelNames.sort()
|
return panelNames.sort()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue