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: {
|
||||
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)
|
||||
const homeIdx = panelNames.indexOf('entities')
|
||||
if (homeIdx >= 0)
|
||||
return ['entities'].concat((panelNames.slice(0, homeIdx).concat(panelNames.slice(homeIdx+1))).sort())
|
||||
panelNames = prepend(panelNames, 'execute')
|
||||
panelNames = prepend(panelNames, 'entities')
|
||||
return panelNames.sort()
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue