From 92fc08fa700683d3a10af0031a9e77fa60b1eb40 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 7 Jan 2015 12:14:47 -0800 Subject: [PATCH] Update property list window to only show after selection --- examples/editEntities.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/editEntities.js b/examples/editEntities.js index 709014bdb8..b65756e9b4 100644 --- a/examples/editEntities.js +++ b/examples/editEntities.js @@ -42,7 +42,15 @@ gridTool = GridTool({ horizontalGrid: grid }); Script.include("libraries/entityList.js"); var entityListTool = EntityListTool(); -selectionManager.addEventListener(selectionDisplay.updateHandles); +var hasShownPropertiesTool = false; + +selectionManager.addEventListener(function() { + selectionDisplay.updateHandles(); + if (selectionManager.hasSelection() && !hasShownPropertiesTool) { + propertiesTool.setVisible(true); + hasShownPropertiesTool = true; + } +}); var windowDimensions = Controller.getViewportDimensions(); var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; @@ -223,10 +231,9 @@ var toolBar = (function () { selectionManager.clearSelections(); cameraManager.disable(); } else { + hasShownPropertiesTool = false; cameraManager.enable(); - entityListTool.setVisible(true); gridTool.setVisible(true); - propertiesTool.setVisible(true); grid.setEnabled(true); } }