From fb516cf13c0f36cbab2d27ad49e1f6a9403f957f Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Tue, 10 Nov 2020 00:01:15 -0500 Subject: [PATCH] Highlight the last selected entity in the List The last selected entity is now displayed in darker blue in the list (if present per radius search) This makes clear which entity could become the parent. (This enlights some weird behavior with the Selection, making this hazardous to figure which one was the true last selected entity. To be addressed later, it's already better now.) --- .../create/entityList/html/js/entityList.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/system/create/entityList/html/js/entityList.js b/scripts/system/create/entityList/html/js/entityList.js index aa23784eea..c0b28532cb 100644 --- a/scripts/system/create/entityList/html/js/entityList.js +++ b/scripts/system/create/entityList/html/js/entityList.js @@ -188,6 +188,8 @@ let selectedEntities = []; let entityList = null; // The ListView let hmdMultiSelectMode = false; + +let lastSelectedEntity; /** * @type EntityListContextMenu */ @@ -1047,6 +1049,8 @@ function loaded() { function updateSelectedEntities(selectedIDs, autoScroll) { let notFound = false; + lastSelectedEntity = selectedIDs[selectedIDs.length - 1]; + // reset all currently selected entities and their rows first selectedEntities.forEach(function(id) { let entity = entitiesByID[id]; @@ -1066,7 +1070,11 @@ function loaded() { if (entity !== undefined) { entity.selected = true; if (entity.elRow) { - entity.elRow.className = 'selected'; + if (id === lastSelectedEntity) { + entity.elRow.className = 'last-selected'; + } else { + entity.elRow.className = 'selected'; + } } } else { notFound = true; @@ -1135,7 +1143,11 @@ function loaded() { // if this entity was previously selected flag it's row as selected if (itemData.selected) { - elRow.className = 'selected'; + if (itemData.id === lastSelectedEntity) { + elRow.className = 'last-selected'; + } else { + elRow.className = 'selected'; + } } else { elRow.className = ''; }