Fakultas Ilmu Komputer UI

Commit 5ae52d49 authored by Rachmat Ridwan's avatar Rachmat Ridwan
Browse files

Hide menu if not selected and fix hierarchy

parent 2257629e
......@@ -31,6 +31,17 @@ function replaceSelection(newSelection) {
updateSliderOnObjectSelected()
}
}
updateSelectionView()
}
function updateSelectionView() {
let currentSelection = sceneGraph.selectedNodeName
let node = sceneGraph.nodes[currentSelection]
if (!node) {
document.querySelector('#selected-object-menu').classList.add('no-selection')
} else {
document.querySelector('#selected-object-menu').classList.remove('no-selection')
}
displaySelectionHierarchyText()
}
......@@ -52,6 +63,10 @@ function displaySelectionHierarchyText() {
}
let parentNameList = selectionNode.parentNameList
// Reverse parent name list
let count = parentNameList.length
parentNameList = parentNameList.map((data, i) => parentNameList[count - i - 1])
let hierarchyList = [...parentNameList, selectionModelName]
hierarchyList.forEach(modelName => {
......
......@@ -330,7 +330,7 @@ canvas:focus + * > #canvas-status {
display: block;
}
#help-content strong {
.note strong, #help-content strong {
color: white;
}
......@@ -540,3 +540,7 @@ ul > li:last-child::before {
#selobj-hierarchy > *:last-child {
font-weight: bold;
}
#selected-object-menu.no-selection {
display: none;
}
\ No newline at end of file
......@@ -128,8 +128,8 @@ main()
<div class="menu">
<div class="submenu">
<h3 class="submenu-title">Tree Objek</h3>
<label class="note">Bantuan: untuk memilih objek, klik kanan (pada desktop)
atau tekan dan tahan yang lama (pada mobile)</label>
<label class="note">Bantuan: untuk memilih objek, <strong>klik kanan</strong> (pada desktop)
atau <strong>tekan dan tahan</strong> yang lama (pada mobile)</label>
<div id="tree">
<div class="obj-name" id="root-node">Root</div>
<ul>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment