sort screens alphabetically
This commit is contained in:
parent
c329063f61
commit
38e052c429
|
@ -11,6 +11,9 @@
|
||||||
|
|
||||||
export let screens = []
|
export let screens = []
|
||||||
|
|
||||||
|
$: sortedScreens = screens.sort(
|
||||||
|
(s1, s2) => s1.props._instanceName > s2.props._instanceName
|
||||||
|
)
|
||||||
/*
|
/*
|
||||||
Using a store here seems odd....
|
Using a store here seems odd....
|
||||||
have a look in the <ComponentsHierarchyChildren /> code file to find out why.
|
have a look in the <ComponentsHierarchyChildren /> code file to find out why.
|
||||||
|
@ -24,12 +27,15 @@
|
||||||
const joinPath = join("/")
|
const joinPath = join("/")
|
||||||
|
|
||||||
const normalizedName = name =>
|
const normalizedName = name =>
|
||||||
pipe(name, [
|
pipe(
|
||||||
|
name,
|
||||||
|
[
|
||||||
trimCharsStart("./"),
|
trimCharsStart("./"),
|
||||||
trimCharsStart("~/"),
|
trimCharsStart("~/"),
|
||||||
trimCharsStart("../"),
|
trimCharsStart("../"),
|
||||||
trimChars(" "),
|
trimChars(" "),
|
||||||
])
|
]
|
||||||
|
)
|
||||||
|
|
||||||
const changeScreen = screen => {
|
const changeScreen = screen => {
|
||||||
store.setCurrentScreen(screen.props._instanceName)
|
store.setCurrentScreen(screen.props._instanceName)
|
||||||
|
@ -38,7 +44,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="root">
|
<div class="root">
|
||||||
{#each screens as screen}
|
{#each sortedScreens as screen}
|
||||||
<div
|
<div
|
||||||
class="budibase__nav-item screen-header-row"
|
class="budibase__nav-item screen-header-row"
|
||||||
class:selected={$store.currentComponentInfo._id === screen.props._id}
|
class:selected={$store.currentComponentInfo._id === screen.props._id}
|
||||||
|
|
Loading…
Reference in New Issue