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,7 +1184,11 @@ function loaded() {
if (entity !== undefined) {
entity.selected = false;
if (entity.elRow) {
entity.elRow.className = "";
if (entity.entityHostType === "avatar") {
entity.elRow.className = "avatarEntity";
} else {
entity.elRow.className = "";
}
}
}
});
@ -1197,9 +1202,17 @@ function loaded() {
entity.selected = true;
if (entity.elRow) {
if (id === lastSelectedEntity) {
entity.elRow.className = "last-selected";
if (entity.entityHostType === "avatar") {
entity.elRow.className = "lastSelAvatarEntity";
} else {
entity.elRow.className = "last-selected";
}
} else {
entity.elRow.className = "selected";
if (entity.entityHostType === "avatar") {
entity.elRow.className = "selAvatarEntity";
} else {
entity.elRow.className = "selected";
}
}
}
} else {
@ -1270,12 +1283,24 @@ function loaded() {
// if this entity was previously selected flag it's row as selected
if (itemData.selected) {
if (itemData.id === lastSelectedEntity) {
elRow.className = "last-selected";
if (itemData.entityHostType === "avatar") {
elRow.className = "lastSelAvatarEntity";
} else {
elRow.className = "last-selected";
}
} else {
elRow.className = "selected";
if (itemData.entityHostType === "avatar") {
elRow.className = "selAvatarEntity";
} else {
elRow.className = "selected";
}
}
} else {
elRow.className = "";
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