mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 13:19:54 +02:00
Fix entity list selection failing when selecting entities not in list
This commit is contained in:
parent
3b1e0dc7d9
commit
72adfb7ff0
1 changed files with 10 additions and 4 deletions
|
@ -161,7 +161,10 @@ function loaded() {
|
||||||
|
|
||||||
selectedEntities.forEach(function(entityID) {
|
selectedEntities.forEach(function(entityID) {
|
||||||
if (selection.indexOf(entityID) === -1) {
|
if (selection.indexOf(entityID) === -1) {
|
||||||
entitiesByID[entityID].el.className = '';
|
let entity = entitiesByID[entityID];
|
||||||
|
if (entity !== undefined) {
|
||||||
|
entity.el.className = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -385,15 +388,18 @@ function loaded() {
|
||||||
let notFound = false;
|
let notFound = false;
|
||||||
|
|
||||||
selectedEntities.forEach(function(id) {
|
selectedEntities.forEach(function(id) {
|
||||||
entitiesByID[id].el.className = '';
|
let entity = entitiesByID[id];
|
||||||
|
if (entity !== undefined) {
|
||||||
|
entity.el.className = '';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
selectedEntities = [];
|
selectedEntities = [];
|
||||||
for (let i = 0; i < selectedIDs.length; i++) {
|
for (let i = 0; i < selectedIDs.length; i++) {
|
||||||
let id = selectedIDs[i];
|
let id = selectedIDs[i];
|
||||||
selectedEntities.push(id);
|
selectedEntities.push(id);
|
||||||
if (id in entitiesByID) {
|
let entity = entitiesByID[id];
|
||||||
let entity = entitiesByID[id];
|
if (entity !== undefined) {
|
||||||
entity.el.className = 'selected';
|
entity.el.className = 'selected';
|
||||||
} else {
|
} else {
|
||||||
notFound = true;
|
notFound = true;
|
||||||
|
|
Loading…
Reference in a new issue