Adding Avatar Entity Highlighting

Adding Avatar Entity Highlighting
This commit is contained in:
Alezia Kurdis 2024-09-29 20:52:07 -04:00 committed by GitHub
parent 151546619d
commit 652bb6f6da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -987,6 +987,7 @@ function loaded() {
parentState: entity.parentState,
created: entity.created,
lastEdited: entity.lastEdited,
entityHostType: entity.entityHostType,
elRow: null, // if this entity has a visible row element assigned to it
selected: false // if this entity is selected for edit regardless of having a visible row
};
@ -1183,9 +1184,13 @@ function loaded() {
if (entity !== undefined) {
entity.selected = false;
if (entity.elRow) {
if (entity.entityHostType === "avatar") {
entity.elRow.className = "avatarEntity";
} else {
entity.elRow.className = "";
}
}
}
});
// then reset selected entities list with newly selected entities and set them selected
@ -1197,11 +1202,19 @@ function loaded() {
entity.selected = true;
if (entity.elRow) {
if (id === lastSelectedEntity) {
if (entity.entityHostType === "avatar") {
entity.elRow.className = "lastSelAvatarEntity";
} else {
entity.elRow.className = "last-selected";
}
} else {
if (entity.entityHostType === "avatar") {
entity.elRow.className = "selAvatarEntity";
} else {
entity.elRow.className = "selected";
}
}
}
} else {
notFound = true;
}
@ -1270,13 +1283,25 @@ function loaded() {
// if this entity was previously selected flag it's row as selected
if (itemData.selected) {
if (itemData.id === lastSelectedEntity) {
if (itemData.entityHostType === "avatar") {
elRow.className = "lastSelAvatarEntity";
} else {
elRow.className = "last-selected";
}
} else {
if (itemData.entityHostType === "avatar") {
elRow.className = "selAvatarEntity";
} else {
elRow.className = "selected";
}
}
} else {
if (itemData.entityHostType === "avatar") {
elRow.className = "avatarEntity";
} else {
elRow.className = "";
}
}
// if this row previously had an associated entity ID that wasn't the new entity ID then clear
// the ID from the row and the row element from the previous entity's data, then set the new