mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-24 08:26:01 +00:00
Sort unknown components to the bottom
This commit is contained in:
committed by
Brandon Thomas
parent
cd19b3e593
commit
c64a2e9d29
@@ -40,6 +40,10 @@ export class EntityInspectorElement extends LitElement {
|
|||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
const ordA = COMPONENT_SORT_ORDER.indexOf(a.name);
|
const ordA = COMPONENT_SORT_ORDER.indexOf(a.name);
|
||||||
const ordB = COMPONENT_SORT_ORDER.indexOf(b.name);
|
const ordB = COMPONENT_SORT_ORDER.indexOf(b.name);
|
||||||
|
|
||||||
|
if (ordA === -1) return 1;
|
||||||
|
if (ordB === -1) return -1;
|
||||||
|
|
||||||
return ordA - ordB;
|
return ordA - ordB;
|
||||||
})
|
})
|
||||||
.map(({ name, value }) => {
|
.map(({ name, value }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user