From e8154b5df18fc881153120248c3d6a39902b8a80 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 17 Jun 2018 08:35:45 +1200 Subject: [PATCH] Fix Create app selection updating when entities are deleted --- scripts/system/edit.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 05f5e3cb19..02af474f55 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -475,18 +475,18 @@ var toolBar = (function () { var DELETE_ENTITY_TIMER_TIMEOUT = 100; function checkDeletedEntityAndUpdate(entityID) { - // Allow for multiple entity deletes before updating the entity list. - entitiesToDelete.push(entityID); - if (deletedEntityTimer !== null) { - Script.clearTimeout(deletedEntityTimer); + if (selectionManager.selections.indexOf(entityID) !== -1) { + // Allow for multiple entity deletes before updating the entities selected. + entitiesToDelete.push(entityID); + if (deletedEntityTimer !== null) { + Script.clearTimeout(deletedEntityTimer); + } + deletedEntityTimer = Script.setTimeout(function () { + selectionManager.removeEntities(entitiesToDelete); + entitiesToDelete = []; + deletedEntityTimer = null; + }, DELETE_ENTITY_TIMER_TIMEOUT); } - deletedEntityTimer = Script.setTimeout(function () { - selectionManager.removeEntities(entitiesToDelete); - entityListTool.clearEntityList(); - entityListTool.sendUpdate(); - entitiesToDelete = []; - deletedEntityTimer = null; - }, DELETE_ENTITY_TIMER_TIMEOUT); } function initialize() {