From 556aec94121babbc47a03e1d38ff052bffd29a1a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 15 Nov 2018 15:27:30 -0800 Subject: [PATCH] Fix hiding of properties in Create --- scripts/system/html/css/edit-style.css | 12 +++++++++++- scripts/system/html/js/entityProperties.js | 14 ++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/scripts/system/html/css/edit-style.css b/scripts/system/html/css/edit-style.css index 3a291bf27b..bec926ad03 100644 --- a/scripts/system/html/css/edit-style.css +++ b/scripts/system/html/css/edit-style.css @@ -1559,7 +1559,9 @@ input.rename-entity { .container > label { margin-top: 6px; - width: 200px; + width: 160px; + min-width: 160px; + max-width: 160px; } .container > div.checkbox { @@ -1650,3 +1652,11 @@ input.number-slider { display: flex; width: 100%; } + +.spacemode-hidden { + display: none; +} + +#placeholder-property-type { + min-width: 0px; +} diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index c49e0d88f6..a4cde98abe 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -29,7 +29,7 @@ const ICON_FOR_TYPE = { const DEGREES_TO_RADIANS = Math.PI / 180.0; -const NO_SELECTION = "w"; +const NO_SELECTION = ","; const PROPERTY_SPACE_MODE = { ALL: 0, @@ -1244,8 +1244,9 @@ const GROUPS = [ showPropertyRule: { "collisionless": "false" }, }, { - label: "Collision sound URL", + label: "Collision Sound", type: "string", + placeholder: "URL", propertyID: "collisionSoundURL", showPropertyRule: { "collisionless": "false" }, }, @@ -1500,7 +1501,7 @@ function disableProperties() { function showPropertyElement(propertyID, show) { let elProperty = properties[propertyID].elContainer; - elProperty.style.display = show ? "flex" : "none"; + elProperty.style.display = show ? "" : "none"; } function resetProperties() { @@ -1622,10 +1623,11 @@ function updateVisibleSpaceModeProperties() { if (properties.hasOwnProperty(propertyID)) { let property = properties[propertyID]; let propertySpaceMode = property.spaceMode; - if (propertySpaceMode !== PROPERTY_SPACE_MODE.ALL) { - showPropertyElement(propertyID, propertySpaceMode === currentSpaceMode); + let elProperty = properties[propertyID].elContainer; + if (propertySpaceMode !== PROPERTY_SPACE_MODE.ALL && propertySpaceMode !== currentSpaceMode) { + elProperty.classList.add('spacemode-hidden'); } else { - showPropertyElement(propertyID, true); + elProperty.classList.remove('spacemode-hidden'); } } }