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.)
This commit is contained in:
Alezia Kurdis 2020-11-10 00:01:15 -05:00 committed by GitHub
parent 9c48acf1d3
commit fb516cf13c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = '';
}